void PapyrusDesktop::setPapyrusSync(PapyrusSync *ksync) { p->sync = ksync; connect( p->sync, SIGNAL(syncStarted()) , SLOT(syncStarted()) ); connect( p->sync, SIGNAL(syncProgress(qreal)), SLOT(syncProgress(qreal)) ); connect( p->sync, SIGNAL(syncFinished()) , SLOT(syncFinished()) ); }
void KaqazDesktop::setKaqazSync(KaqazSync *ksync) { p->sync = ksync; connect( p->sync, SIGNAL(syncStarted()) , SLOT(syncStarted()) ); connect( p->sync, SIGNAL(syncProgress(qreal)), SLOT(syncProgress(qreal)) ); connect( p->sync, SIGNAL(syncFinished()) , SLOT(syncFinished()) ); }
// Sends the next group in groupsToUpload and download status for // next in groupsToDownload void SyncMaster::processGroups() { fdb.checkSanity(); // qDebug() << Q_FUNC_INFO << "Groups to upload: " << groupsToUpload.size() << " download: " << groupsToDownload.size(); if(canceled) return; if (groupsToUpload.isEmpty() && groupsToDownload.isEmpty()) { emit syncFinished(true, QString::null); return; } // Do the uploading if(!groupsToUpload.isEmpty()) { ForumGroup *g = groupsToUpload.takeFirst(); g->subscription()->setBeingSynced(true); g->setChangeset(rand()); for(ForumThread *thread : g->values()) { Q_ASSERT(thread); messagesToUpload.append(thread->values()); } connect(&protocol, SIGNAL(sendThreadDataFinished(bool, QString)), this, SLOT(sendThreadDataFinished(bool, QString))); protocol.sendThreadData(g, messagesToUpload); g->setHasChanged(false); g->commitChanges(); messagesToUpload.clear(); emit syncProgress(0, "Synchronizing " + g->name() + " in " + g->subscription()->alias() + ".."); g->subscription()->setBeingSynced(false); }