void addCustomChanges( Change::List &changes ) { #if 0 KCal::CalendarResourceManager m1( "calendar" ); m1.readConfig(); KCal::CalendarResourceManager::Iterator it; for ( it = m1.begin(); it != m1.end(); ++it ) { if ( (*it)->type() == "exchange" ) break; } if ( it == m1.end() ) { changes.append( new CreateExchangeKcalResource ); } else { if ( (*it)->identifier() == ExchangeConfig::kcalResource() ) { KCal::ExchangePrefs *prefs = static_cast<KCal::ResourceExchange *>( *it )->prefs(); if ( prefs->url() != exchangeUrl() || prefs->user() != ExchangeConfig::user() || prefs->password() != ExchangeConfig::password() ) { changes.append( new UpdateExchangeKcalResource ); } } } KRES::Manager<KABC::Resource> m2( "contact" ); m2.readConfig(); KRES::Manager<KABC::Resource>::Iterator it2; for ( it2 = m2.begin(); it2 != m2.end(); ++it2 ) { if ( (*it2)->type() == "exchange" ) break; } if ( it2 == m2.end() ) { changes.append( new CreateExchangeKabcResource ); } else { if ( (*it2)->identifier() == ExchangeConfig::kabcResource() ) { KABC::ExchangePrefs *prefs = static_cast<KABC::ResourceExchange *>( *it2 )->prefs(); if ( prefs->url() != exchangeUrl() || prefs->user() != ExchangeConfig::user() || prefs->password() != ExchangeConfig::password() ) { changes.append( new UpdateExchangeKabcResource ); } } } #endif }
virtual void addCustomChanges( Change::List &changes ) { addKorganizerChanges( changes ); // KMail cruft has been outsourced to kolabkmailchanges.cpp createKMailChanges( changes ); changes.append( new SetupLDAPSearchAccount ); KCal::CalendarResourceManager m( "calendar" ); m.readConfig(); KCal::CalendarResourceManager::Iterator it; for ( it = m.begin(); it != m.end(); ++it ) { if ( (*it)->type() == "imap" ) break; } if ( it == m.end() ) { changes.append( new CreateCalendarImapResource ); changes.append( new CreateContactImapResource ); changes.append( new CreateNotesImapResource ); } }
bool EwsSyncFolderHierarchyRequest::Response::changeReader(QXmlStreamReader &reader, QVariant &val) { Change::List changes; QString elmName(reader.name().toString()); while (reader.readNextStartElement()) { Change change(reader); if (!change.isValid()) { qCWarningNC(EWSRES_LOG) << QStringLiteral("Failed to read %1 element").arg(elmName); return false; } changes.append(change); } val = QVariant::fromValue<Change::List>(changes); return true; }
void addKorganizerChanges( Change::List &changes ) { KURL freeBusyBaseUrl; // usrWriteConfig() is called first, so kolab1Legacy is correct if ( KolabConfig::self()->kolab1Legacy() ) { freeBusyBaseUrl = "webdavs://" + KolabConfig::self()->server() + "/freebusy/"; ChangeConfig *c = new ChangeConfig; c->file = "korganizerrc"; c->group = "FreeBusy"; c->name = "FreeBusyPublishUrl"; QString user = KolabConfig::self()->user(); // We now use the full email address in the freebusy URL //int pos = user.find( "@" ); //if ( pos > 0 ) user = user.left( pos ); KURL publishURL = freeBusyBaseUrl; publishURL.addPath( user + ".ifb" ); // this encodes the '@' in the username c->value = publishURL.url(); changes.append( c ); } else { // Kolab2: only need FreeBusyRetrieveUrl // "Uploading" is done by triggering a server-side script with an HTTP GET // (done by kmail) freeBusyBaseUrl = "https://" + KolabConfig::self()->server() + "/freebusy/"; } ChangeConfig *c = new ChangeConfig; c->file = "korganizerrc"; c->group = "FreeBusy"; c->name = "FreeBusyRetrieveUrl"; c->value = freeBusyBaseUrl.url(); changes.append( c ); // Use full email address for retrieval of free/busy lists c = new ChangeConfig; c->file = "korganizerrc"; c->group = "FreeBusy"; c->name = "FreeBusyFullDomainRetrieval"; c->value = "true"; changes.append( c ); c = new ChangeConfig; c->file = "korganizerrc"; c->group = "Group Scheduling"; c->name = "Use Groupware Communication"; c->value = "true"; changes.append( c ); // Use identity "from control center", i.e. from emaildefaults c = new ChangeConfig; c->file = "korganizerrc"; c->group = "Personal Settings"; c->name = "Use Control Center Email"; c->value = "true"; changes.append( c ); }