void ConnectionValidator::checkServerCapabilities() { JsonApiJob *job = new JsonApiJob(_account, QLatin1String("ocs/v1.php/cloud/capabilities"), this); job->setTimeout(timeoutToUseMsec); QObject::connect(job, SIGNAL(jsonReceived(QVariantMap, int)), this, SLOT(slotCapabilitiesRecieved(QVariantMap))); job->start(); }
void ConnectionValidator::fetchUser() { JsonApiJob *job = new JsonApiJob(_account, QLatin1String("ocs/v1.php/cloud/user"), this); job->setTimeout(timeoutToUseMsec); QObject::connect(job, SIGNAL(jsonReceived(QVariantMap, int)), this, SLOT(slotUserFetched(QVariantMap))); job->start(); }
void ActivityListModel::startFetchJob(AccountState* s) { if( !s->isConnected() ) { return; } JsonApiJob *job = new JsonApiJob(s->account(), QLatin1String("ocs/v1.php/cloud/activity"), this); QObject::connect(job, SIGNAL(jsonReceived(QVariantMap, int)), this, SLOT(slotActivitiesReceived(QVariantMap, int))); job->setProperty("AccountStatePtr", QVariant::fromValue<AccountState*>(s)); QList< QPair<QString,QString> > params; params.append(qMakePair(QString::fromLatin1("page"), QString::fromLatin1("0"))); params.append(qMakePair(QString::fromLatin1("pagesize"), QString::fromLatin1("100"))); job->addQueryParams(params); _currentlyFetching.insert(s); qDebug() << "Start fetching activities for " << s->account()->displayName(); job->start(); }