Changeset View
Changeset View
Standalone View
Standalone View
common/carddav-contacts-sync/carddav-plugin.cpp
Context not available. | |||||
73 | } | 73 | } | ||
---|---|---|---|---|---|
74 | 74 | | |||
75 | qDebug() << "List of accounts to sync:" << syncedAccounts; | 75 | qDebug() << "List of accounts to sync:" << syncedAccounts; | ||
76 | | ||||
77 | Q_FOREACH (const quint32 accountId, syncedAccounts) { | 76 | Q_FOREACH (const quint32 accountId, syncedAccounts) { | ||
78 | KConfigGroup currentAccount = d->config->group("account" + accountId); | 77 | KConfigGroup currentAccount = d->config->group("account" + QString::number(accountId)); | ||
79 | QDateTime lastSync = QDateTime::fromString(currentAccount.readEntry("lastSync", QStringLiteral("2000-09-22T00:00:00+00:00")), Qt::ISODate); | 78 | QDateTime lastSync = QDateTime::fromString(currentAccount.readEntry("lastSync", QStringLiteral("2000-09-22T00:00:00+00:00")), Qt::ISODate); | ||
80 | if (QDateTime::currentDateTime() > lastSync) { | 79 | if (QDateTime::currentDateTime() > lastSync) { | ||
81 | qDebug() << "Starting carddav contacts import for account" << accountId; | 80 | qDebug() << "Starting carddav contacts import for account" << accountId; | ||
Context not available. | |||||
171 | global.writeEntry("syncedAccounts", syncedAccounts); | 170 | global.writeEntry("syncedAccounts", syncedAccounts); | ||
172 | global.sync(); | 171 | global.sync(); | ||
173 | 172 | | |||
174 | KConfigGroup currentAccount = d->config->group("account" + accountId); | 173 | KConfigGroup currentAccount = d->config->group("account" + QString::number(accountId)); | ||
175 | currentAccount.writeEntry("lastSync", QDateTime::currentDateTime().toString(Qt::ISODate)); | 174 | currentAccount.writeEntry("lastSync", QDateTime::currentDateTime().toString(Qt::ISODate)); | ||
176 | currentAccount.sync(); | 175 | currentAccount.sync(); | ||
177 | }); | 176 | }); | ||
Context not available. |