void run() { AkonadiSource *source = appSource->getSyncSource(); AppSyncSourceConfig* sourceConfig = appSource->getConfig(); source->setCollectionId(sourceConfig->getCollectionId()); SyncSourceConfig *srcConfig = KFunSyncConfig::getInstance()->getSyncSourceConfig(source->getName()); if (srcConfig != NULL) { source->setConfig(srcConfig); } const char* remoteUri = sourceConfig->getRemoteUri(); if (remoteUri == NULL || strlen(remoteUri) == 0) { sourceConfig->setRemoteUri(srcConfig->getURI()); sourceConfig->save(); } else { srcConfig->setURI(remoteUri); } SyncSource* ssArray[] = { source, NULL } ; if (client->sync(*KFunSyncConfig::getInstance(), ssArray)) { LOG.error("Error during sync.\n"); } // Save the anchors KFunSyncConfig::getInstance()->save(); manager->emitSourceEnded(appSource, client->getSyncReport()); }
void SyncSourceConfig::assign(const SyncSourceConfig& sc) { if (&sc == this) { return; } setName (sc.getName ()); setURI (sc.getURI ()); setSyncModes (sc.getSyncModes ()); setType (sc.getType ()); setSync (sc.getSync ()); setLast (sc.getLast ()); setEncoding (sc.getEncoding ()); setVersion (sc.getVersion ()); setSupportedTypes(sc.getSupportedTypes()); setSyncMode (sc.getSyncMode ()); setIsAllowed (sc.isAllowed ()); // setCtCap (sc.getCtCap ()); setEncryption (sc.getEncryption ()); setLastSourceError(sc.getLastSourceError()); setLastSyncServerTime(sc.AbstractSyncSourceConfig::getLastSyncServerTime()); extraProps = sc.getExtraProps(); }