Commit 99d31082 authored by Shashwat Jolly's avatar Shashwat Jolly
Browse files

Add custom task for handling EteSync conflict error

Clean up and refactor some code
parent 8f74a91c
......@@ -17,19 +17,15 @@
#include "basehandler.h"
#include <AkonadiCore/AttributeFactory>
#include <AkonadiCore/CollectionColorAttribute>
#include <AkonadiCore/CollectionModifyJob>
#include <KCalendarCore/ICalFormat>
#include <KCalendarCore/MemoryCalendar>
#include <QFile>
#include <ItemSync>
#include "entriesfetchjob.h"
#include "etesync_debug.h"
#include "etesyncresource.h"
using namespace Akonadi;
using namespace KCalendarCore;
using namespace EteSyncAPI;
BaseHandler::BaseHandler(EteSyncResource *resource)
: mResource(resource), mClientState(resource->mClientState)
......@@ -41,14 +37,41 @@ void BaseHandler::initialiseBaseDirectory()
mResource->initialiseDirectory(baseDirectoryPath());
}
void BaseHandler::createEteSyncEntry(const EteSyncSyncEntry *syncEntry, const EteSyncCryptoManager *cryptoManager, const Collection &collection)
void BaseHandler::setupItems(EteSyncEntry **entries, Akonadi::Collection &collection)
{
qCDebug(ETESYNC_LOG) << "BaseHandler: Setting up items";
QString prevUid = collection.remoteRevision();
const QString journalUid = collection.remoteId();
const bool isIncremental = (prevUid.isEmpty() || prevUid.isNull()) ? false : true;
Item::List changedItems;
Item::List removedItems;
getItemListFromEntries(entries, changedItems, removedItems, collection, journalUid, prevUid);
collection.setRemoteRevision(prevUid);
new CollectionModifyJob(collection, this);
if (isIncremental) {
mResource->itemsRetrievedIncremental(changedItems, removedItems);
} else {
mResource->itemsRetrieved(changedItems);
}
}
bool BaseHandler::createEteSyncEntry(const EteSyncSyncEntry *syncEntry, const EteSyncCryptoManager *cryptoManager, const Collection &collection)
{
EteSyncEntryPtr entry(etesync_entry_from_sync_entry(cryptoManager, syncEntry, collection.remoteRevision()));
EteSyncEntryManagerPtr entryManager(etesync_entry_manager_new(mClientState->client(), collection.remoteId()));
EteSyncEntry *entries[] = {entry.get(), NULL};
etesync_entry_manager_create(entryManager.get(), entries, collection.remoteRevision());
const auto result = etesync_entry_manager_create(entryManager.get(), entries, collection.remoteRevision());
if (result) {
handleConflictError(collection);
return false;
}
updateCollectionRevision(entry.get(), collection);
return true;
}
void BaseHandler::updateCollectionRevision(const EteSyncEntry *entry, const Collection &collection)
......@@ -57,4 +80,65 @@ void BaseHandler::updateCollectionRevision(const EteSyncEntry *entry, const Coll
Collection col = collection;
col.setRemoteRevision(entryUid);
new CollectionModifyJob(col, this);
}
void BaseHandler::syncCollection(const QVariant &collectionVariant)
{
const Collection collection = collectionVariant.value<Collection>();
auto job = new EntriesFetchJob(mClientState->client(), collection, this);
connect(job, &EntriesFetchJob::finished, this, &BaseHandler::slotItemsRetrieved);
job->start();
}
void BaseHandler::slotItemsRetrieved(KJob *job)
{
if (job->error()) {
qCWarning(ETESYNC_LOG) << job->errorText();
return;
}
EteSyncEntry **entries = qobject_cast<EntriesFetchJob *>(job)->entries();
Collection collection = qobject_cast<EntriesFetchJob *>(job)->collection();
qCDebug(ETESYNC_LOG) << "BaseHandler: Syncing items";
QString prevUid = collection.remoteRevision();
const QString journalUid = collection.remoteId();
const bool isIncremental = (prevUid.isEmpty() || prevUid.isNull()) ? false : true;
Item::List changedItems;
Item::List removedItems;
getItemListFromEntries(entries, changedItems, removedItems, collection, journalUid, prevUid);
collection.setRemoteRevision(prevUid);
new CollectionModifyJob(collection, this);
ItemSync *syncer = new ItemSync(collection);
if (isIncremental) {
syncer->setIncrementalSyncItems(changedItems, removedItems);
} else {
syncer->setFullSyncItems(changedItems);
}
connect(syncer, SIGNAL(result(KJob *)), this, SLOT(taskDone()));
}
bool BaseHandler::handleConflictError(const Collection &collection)
{
if (etesync_get_error_code() == EteSyncErrorCode::ETESYNC_ERROR_CODE_CONFLICT) {
mResource->deferTask();
mResource->scheduleCustomTask(this, "syncCollection", QVariant::fromValue(collection), ResourceBase::Prepend);
return false;
}
return true;
}
void BaseHandler::taskDone()
{
mResource->taskDone();
}
\ No newline at end of file
......@@ -38,7 +38,7 @@ public:
virtual const QString mimeType() = 0;
virtual void setupItems(EteSyncEntry **entries, Akonadi::Collection &collection) = 0;
virtual void setupItems(EteSyncEntry **entries, Akonadi::Collection &collection);
virtual void itemAdded(const Akonadi::Item &item, const Akonadi::Collection &collection) = 0;
virtual void itemChanged(const Akonadi::Item &item, const QSet<QByteArray> &parts) = 0;
......@@ -48,13 +48,22 @@ public:
virtual void collectionChanged(const Akonadi::Collection &collection) = 0;
virtual void collectionRemoved(const Akonadi::Collection &collection) = 0;
protected Q_SLOTS:
void slotItemsRetrieved(KJob *job);
virtual void syncCollection(const QVariant &collectionVariant);
void taskDone();
protected:
void initialiseBaseDirectory();
void createEteSyncEntry(const EteSyncSyncEntry *syncEntry, const EteSyncCryptoManager *cryptoManager, const Collection &collection);
bool createEteSyncEntry(const EteSyncSyncEntry *syncEntry, const EteSyncCryptoManager *cryptoManager, const Collection &collection);
void updateCollectionRevision(const EteSyncEntry *entry, const Collection &collection);
virtual QString baseDirectoryPath() const = 0;
virtual const QString etesyncCollectionType() = 0;
virtual void getItemListFromEntries(EteSyncEntry **entries, Item::List &changedItems, Item::List &removedItems, Collection &collection, const QString &journalUid, QString &prevUid) = 0;
bool handleConflictError(const Collection &collection);
EteSyncResource *mResource = nullptr;
EteSyncClientState *mClientState = nullptr;
......
......@@ -36,26 +36,13 @@ CalendarTaskBaseHandler::CalendarTaskBaseHandler(EteSyncResource *resource) : Ba
initialiseBaseDirectory();
}
void CalendarTaskBaseHandler::setupItems(EteSyncEntry **entries, Akonadi::Collection &collection)
void CalendarTaskBaseHandler::getItemListFromEntries(EteSyncEntry **entries, Item::List &changedItems, Item::List &removedItems, Collection &collection, const QString &journalUid, QString &prevUid)
{
qCDebug(ETESYNC_LOG) << "CalendarTaskBaseHandler: Setting up items";
QString prevUid = collection.remoteRevision();
const QString journalUid = collection.remoteId();
bool isIncremental = false;
if (!prevUid.isEmpty() && !prevUid.isNull()) {
isIncremental = true;
}
EteSyncJournalPtr journal(etesync_journal_manager_fetch(mClientState->journalManager(), journalUid));
EteSyncCryptoManagerPtr cryptoManager(etesync_journal_get_crypto_manager(journal.get(), mClientState->derived(), mClientState->keypair()));
QMap<QString, KCalendarCore::Incidence::Ptr> incidences;
Item::List changedItems;
Item::List removedItems;
for (EteSyncEntry **iter = entries; *iter; iter++) {
EteSyncEntryPtr entry(*iter);
EteSyncSyncEntryPtr syncEntry(etesync_entry_get_sync_entry(entry.get(), cryptoManager.get(), prevUid));
......@@ -76,7 +63,6 @@ void CalendarTaskBaseHandler::setupItems(EteSyncEntry **entries, Akonadi::Collec
item.setMimeType(mimeType());
item.setParentCollection(collection);
item.setRemoteId(incidence->uid());
item.setPayload<KCalendarCore::Incidence::Ptr>(incidence);
removedItems << item;
deleteLocalCalendar(incidence);
......@@ -88,9 +74,6 @@ void CalendarTaskBaseHandler::setupItems(EteSyncEntry **entries, Akonadi::Collec
free(entries);
collection.setRemoteRevision(prevUid);
new CollectionModifyJob(collection, this);
for (auto it = incidences.constBegin(); it != incidences.constEnd(); it++) {
Item item;
item.setMimeType(mimeType());
......@@ -101,12 +84,6 @@ void CalendarTaskBaseHandler::setupItems(EteSyncEntry **entries, Akonadi::Collec
updateLocalCalendar(it.value());
}
if (isIncremental) {
mResource->itemsRetrievedIncremental(changedItems, removedItems);
} else {
mResource->itemsRetrieved(changedItems);
}
}
QString CalendarTaskBaseHandler::baseDirectoryPath() const
......@@ -139,7 +116,7 @@ bool CalendarTaskBaseHandler::updateLocalCalendar(const KCalendarCore::Incidence
KCalendarCore::Calendar::Ptr calendar(new MemoryCalendar(QTimeZone::utc()));
calendar->addIncidence(incidence);
KCalendarCore::ICalFormat format;
file.write(charArrFromQString(format.toString(calendar)));
file.write(format.toString(calendar).toUtf8());
return true;
}
......@@ -162,17 +139,13 @@ void CalendarTaskBaseHandler::itemAdded(const Akonadi::Item &item,
EteSyncJournalPtr journal(etesync_journal_manager_fetch(mClientState->journalManager(), collection.remoteId()));
// Handle EteSync conflict error: If stored UID is old, sync and retry
QString lastJournalUid = QStringFromCharPtr(CharPtr(etesync_journal_get_last_uid(journal.get())));
if (lastJournalUid != collection.remoteRevision()) {
mResource->deferTask();
mResource->retrieveItems(collection);
}
EteSyncCryptoManagerPtr cryptoManager(etesync_journal_get_crypto_manager(journal.get(), mClientState->derived(), mClientState->keypair()));
EteSyncSyncEntryPtr syncEntry(etesync_sync_entry_new(QStringLiteral(ETESYNC_SYNC_ENTRY_ACTION_ADD), format.toString(calendar)));
createEteSyncEntry(syncEntry.get(), cryptoManager.get(), collection);
if (!createEteSyncEntry(syncEntry.get(), cryptoManager.get(), collection)) {
return;
}
mResource->changeCommitted(item);
......@@ -190,17 +163,13 @@ void CalendarTaskBaseHandler::itemChanged(const Akonadi::Item &item,
EteSyncJournalPtr journal(etesync_journal_manager_fetch(mClientState->journalManager(), collection.remoteId()));
// Handle EteSync conflict error: If stored UID is old, sync and retry
QString lastJournalUid = QStringFromCharPtr(CharPtr(etesync_journal_get_last_uid(journal.get())));
if (lastJournalUid != collection.remoteRevision()) {
mResource->deferTask();
mResource->retrieveItems(collection);
}
EteSyncCryptoManagerPtr cryptoManager(etesync_journal_get_crypto_manager(journal.get(), mClientState->derived(), mClientState->keypair()));
EteSyncSyncEntryPtr syncEntry(etesync_sync_entry_new(QStringLiteral(ETESYNC_SYNC_ENTRY_ACTION_CHANGE), format.toString(calendar)));
createEteSyncEntry(syncEntry.get(), cryptoManager.get(), collection);
if (!createEteSyncEntry(syncEntry.get(), cryptoManager.get(), collection)) {
return;
}
mResource->changeCommitted(item);
......@@ -213,19 +182,15 @@ void CalendarTaskBaseHandler::itemRemoved(const Akonadi::Item &item)
EteSyncJournalPtr journal(etesync_journal_manager_fetch(mClientState->journalManager(), collection.remoteId()));
// Handle EteSync conflict error: If stored UID is old, sync and retry
QString lastJournalUid = QStringFromCharPtr(CharPtr(etesync_journal_get_last_uid(journal.get())));
if (lastJournalUid != collection.remoteRevision()) {
mResource->deferTask();
mResource->retrieveItems(collection);
}
EteSyncCryptoManagerPtr cryptoManager(etesync_journal_get_crypto_manager(journal.get(), mClientState->derived(), mClientState->keypair()));
QString calendar = getLocalCalendar(item.remoteId());
EteSyncSyncEntryPtr syncEntry(etesync_sync_entry_new(ETESYNC_SYNC_ENTRY_ACTION_DELETE, charArrFromQString(calendar)));
createEteSyncEntry(syncEntry.get(), cryptoManager.get(), collection);
if (!createEteSyncEntry(syncEntry.get(), cryptoManager.get(), collection)) {
return;
}
mResource->changeCommitted(item);
}
......
......@@ -34,7 +34,7 @@ class CalendarTaskBaseHandler : public BaseHandler
public:
explicit CalendarTaskBaseHandler(EteSyncResource *resource);
void setupItems(EteSyncEntry **entries, Akonadi::Collection &collection) override;
void getItemListFromEntries(EteSyncEntry **entries, Item::List &changedItems, Item::List &removedItems, Collection &collection, const QString &journalUid, QString &prevUid);
void itemAdded(const Akonadi::Item &item, const Akonadi::Collection &collection) override;
void itemChanged(const Akonadi::Item &item, const QSet<QByteArray> &parts) override;
......
......@@ -43,26 +43,13 @@ const QString ContactHandler::etesyncCollectionType()
return QStringLiteral(ETESYNC_COLLECTION_TYPE_ADDRESS_BOOK);
}
void ContactHandler::setupItems(EteSyncEntry **entries, Akonadi::Collection &collection)
void ContactHandler::getItemListFromEntries(EteSyncEntry **entries, Item::List &changedItems, Item::List &removedItems, Collection &collection, const QString &journalUid, QString &prevUid)
{
qCDebug(ETESYNC_LOG) << "Setting up items";
QString prevUid = collection.remoteRevision();
QString journalUid = collection.remoteId();
bool isIncremental = false;
if (!prevUid.isEmpty() && !prevUid.isNull()) {
isIncremental = true;
}
EteSyncJournalPtr journal(etesync_journal_manager_fetch(mClientState->journalManager(), journalUid));
EteSyncCryptoManagerPtr cryptoManager(etesync_journal_get_crypto_manager(journal.get(), mClientState->derived(), mClientState->keypair()));
QMap<QString, KContacts::Addressee> contacts;
Item::List changedItems;
Item::List removedItems;
for (EteSyncEntry **iter = entries; *iter; iter++) {
EteSyncEntryPtr entry(*iter);
EteSyncSyncEntryPtr syncEntry(etesync_entry_get_sync_entry(entry.get(), cryptoManager.get(), prevUid));
......@@ -83,7 +70,6 @@ void ContactHandler::setupItems(EteSyncEntry **entries, Akonadi::Collection &col
item.setMimeType(mimeType());
item.setParentCollection(collection);
item.setRemoteId(contact.uid());
item.setPayload<KContacts::Addressee>(contact);
removedItems << item;
deleteLocalContact(contact);
......@@ -95,9 +81,6 @@ void ContactHandler::setupItems(EteSyncEntry **entries, Akonadi::Collection &col
free(entries);
collection.setRemoteRevision(prevUid);
new CollectionModifyJob(collection, this);
for (auto it = contacts.constBegin(); it != contacts.constEnd(); it++) {
Item item;
item.setMimeType(mimeType());
......@@ -108,12 +91,6 @@ void ContactHandler::setupItems(EteSyncEntry **entries, Akonadi::Collection &col
updateLocalContact(it.value());
}
if (isIncremental) {
mResource->itemsRetrievedIncremental(changedItems, removedItems);
} else {
mResource->itemsRetrieved(changedItems);
}
}
QString ContactHandler::baseDirectoryPath() const
......@@ -162,20 +139,16 @@ void ContactHandler::itemAdded(const Akonadi::Item &item,
{
EteSyncJournalPtr journal(etesync_journal_manager_fetch(mClientState->journalManager(), collection.remoteId()));
// Handle EteSync conflict error: If stored UID is old, sync and retry
QString lastJournalUid = QStringFromCharPtr(CharPtr(etesync_journal_get_last_uid(journal.get())));
if (lastJournalUid != collection.remoteRevision()) {
mResource->deferTask();
mResource->retrieveItems(collection);
}
EteSyncCryptoManagerPtr cryptoManager(etesync_journal_get_crypto_manager(journal.get(), mClientState->derived(), mClientState->keypair()));
KContacts::VCardConverter converter;
QByteArray content = converter.createVCard(item.payload<KContacts::Addressee>());
EteSyncSyncEntryPtr syncEntry(etesync_sync_entry_new(ETESYNC_SYNC_ENTRY_ACTION_ADD, content.constData()));
createEteSyncEntry(syncEntry.get(), cryptoManager.get(), collection);
if (!createEteSyncEntry(syncEntry.get(), cryptoManager.get(), collection)) {
return;
}
mResource->changeCommitted(item);
......@@ -189,20 +162,16 @@ void ContactHandler::itemChanged(const Akonadi::Item &item,
EteSyncJournalPtr journal(etesync_journal_manager_fetch(mClientState->journalManager(), collection.remoteId()));
// Handle EteSync conflict error: If stored UID is old, sync and retry
QString lastJournalUid = QStringFromCharPtr(CharPtr(etesync_journal_get_last_uid(journal.get())));
if (lastJournalUid != collection.remoteRevision()) {
mResource->deferTask();
mResource->retrieveItems(collection);
}
EteSyncCryptoManagerPtr cryptoManager(etesync_journal_get_crypto_manager(journal.get(), mClientState->derived(), mClientState->keypair()));
KContacts::VCardConverter converter;
QByteArray content = converter.createVCard(item.payload<KContacts::Addressee>());
EteSyncSyncEntryPtr syncEntry(etesync_sync_entry_new(ETESYNC_SYNC_ENTRY_ACTION_CHANGE, content.constData()));
createEteSyncEntry(syncEntry.get(), cryptoManager.get(), collection);
if (!createEteSyncEntry(syncEntry.get(), cryptoManager.get(), collection)) {
return;
}
mResource->changeCommitted(item);
......@@ -215,19 +184,15 @@ void ContactHandler::itemRemoved(const Akonadi::Item &item)
EteSyncJournalPtr journal(etesync_journal_manager_fetch(mClientState->journalManager(), collection.remoteId()));
// Handle EteSync conflict error: If stored UID is old, sync and retry
QString lastJournalUid = QStringFromCharPtr(CharPtr(etesync_journal_get_last_uid(journal.get())));
if (lastJournalUid != collection.remoteRevision()) {
mResource->deferTask();
mResource->retrieveItems(collection);
}
EteSyncCryptoManagerPtr cryptoManager(etesync_journal_get_crypto_manager(journal.get(), mClientState->derived(), mClientState->keypair()));
QString contact = getLocalContact(item.remoteId());
EteSyncSyncEntryPtr syncEntry(etesync_sync_entry_new(ETESYNC_SYNC_ENTRY_ACTION_DELETE, charArrFromQString(contact)));
createEteSyncEntry(syncEntry.get(), cryptoManager.get(), collection);
if (!createEteSyncEntry(syncEntry.get(), cryptoManager.get(), collection)) {
return;
}
mResource->changeCommitted(item);
}
......
......@@ -37,7 +37,7 @@ public:
const QString mimeType() override;
void setupItems(EteSyncEntry **entries, Akonadi::Collection &collection) override;
void getItemListFromEntries(EteSyncEntry **entries, Item::List &changedItems, Item::List &removedItems, Collection &collection, const QString &journalUid, QString &prevUid);
void itemAdded(const Akonadi::Item &item, const Akonadi::Collection &collection) override;
void itemChanged(const Akonadi::Item &item, const QSet<QByteArray> &parts) override;
......
......@@ -25,7 +25,6 @@ EteSyncClientState::EteSyncClientState()
EteSyncClientState::~EteSyncClientState()
{
etesync_auth_invalidate_token(mClient.get(), mToken);
}
void EteSyncClientState::init()
......@@ -64,6 +63,7 @@ void EteSyncClientState::init()
EteSyncUserInfoPtr userInfo(etesync_user_info_manager_fetch(userInfoManager.get(), mUsername));
if (!userInfo) {
qCWarning(ETESYNC_LOG) << "User info obtained from server is NULL";
invalidateToken();
Q_EMIT clientInitialised(false);
return;
}
......@@ -106,16 +106,21 @@ void EteSyncClientState::refreshToken()
bool EteSyncClientState::initUserInfo()
{
mJournalManager = EteSyncJournalManagerPtr(etesync_journal_manager_new(mClient.get()));
// Get user keypair
EteSyncUserInfoManagerPtr userInfoManager(etesync_user_info_manager_new(mClient.get()));
mUserInfo = EteSyncUserInfoPtr(etesync_user_info_manager_fetch(userInfoManager.get(), mUsername));
if (!mUserInfo) {
qCWarning(ETESYNC_LOG) << "User info obtained from server is NULL";
invalidateToken();
return false;
}
return true;
}
void EteSyncClientState::invalidateToken()
{
etesync_auth_invalidate_token(mClient.get(), mToken);
}
bool EteSyncClientState::initKeypair(const QString &encryptionPassword)
{
mEncryptionPassword = encryptionPassword;
......@@ -131,6 +136,7 @@ bool EteSyncClientState::initKeypair(const QString &encryptionPassword)
return true;
}
/// TODO: Create default journals
void EteSyncClientState::initAccount(const QString &encryptionPassword)
{
mEncryptionPassword = encryptionPassword;
......
......@@ -35,6 +35,7 @@ public:
void initAccount(const QString &encryptionPassword);
void saveSettings();
void refreshToken();
void invalidateToken();
EteSync *client()
{
......
......@@ -85,8 +85,12 @@ EteSyncResource::EteSyncResource(const QString &id)
qCDebug(ETESYNC_LOG) << "Resource started";
}
EteSyncResource::~EteSyncResource()
void EteSyncResource::cleanup()
{
mClientState->invalidateToken();
QDir dir(baseDirectoryPath());
dir.removeRecursively();
ResourceBase::cleanup();
}
void EteSyncResource::configure(WId windowId)
......@@ -151,7 +155,17 @@ void EteSyncResource::retrieveCollections()
collectionsRetrieved(list);
});
job->start();
checkTokenRefresh();
// checkTokenRefresh();
}
bool EteSyncResource::handleTokenError()
{
if (etesync_get_error_code() == EteSyncErrorCode::ETESYNC_ERROR_CODE_UNAUTHORIZED) {
deferTask();
scheduleCustomTask(mClientState, "refreshToken", QVariant(), ResourceBase::Prepend);
return false;
}
return true;
}
void EteSyncResource::setupCollection(Collection &collection, EteSyncJournal *journal)
......@@ -185,6 +199,9 @@ void EteSyncResource::setupCollection(Collection &collection, EteSyncJournal *jo
auto colorAttr = collection.attribute<Akonadi::CollectionColorAttribute>(Collection::AddIfMissing);
colorAttr->setColor(collectionColor);
if (etesync_journal_is_read_only(journal)) {
collection.setRights(Collection::ReadOnly);
}
collection.setRemoteId(journalUid);
collection.setName(displayName);
collection.setContentMimeTypes(mimeTypes);
......@@ -314,7 +331,7 @@ void EteSyncResource::itemAdded(const Akonadi::Item &item,
cancelTask(i18n("Invalid payload type"));
}
checkTokenRefresh();
// checkTokenRefresh();
}
void EteSyncResource::itemChanged(const Akonadi::Item &item,
......@@ -330,7 +347,7 @@ void EteSyncResource::itemChanged(const Akonadi::Item &item,
cancelTask(i18n("Invalid payload type"));
}
checkTokenRefresh();
// checkTokenRefresh();
}
void EteSyncResource::itemRemoved(const Akonadi::Item &item)
......@@ -345,7 +362,7 @@ void EteSyncResource::itemRemoved(const Akonadi::Item &item)
cancelTask(i18n("Invalid payload type"));
}
checkTokenRefresh();
// checkTokenRefresh();
}
void EteSyncResource::collectionAdded(const Akonadi::Collection &collection, const Akonadi::Collection &parent)
......@@ -360,7 +377,7 @@ void EteSyncResource::collectionAdded(const Akonadi::Collection &collection, con
cancelTask(i18n("Unknown collection mimetype"));
}
checkTokenRefresh();
// checkTokenRefresh();
}
void EteSyncResource::collectionChanged(const Akonadi::Collection &collection)
......@@ -375,7 +392,7 @@ void EteSyncResource::collectionChanged(const Akonadi::Collection &collection)
cancelTask(i18n("Unknown collection mimetype"));
}
checkTokenRefresh();
// checkTokenRefresh();
}
void EteSyncResource::collectionRemoved(const Akonadi::Collection &collection)
......@@ -391,7 +408,7 @@ void EteSyncResource::collectionRemoved(const Akonadi::Collection &collection)
cancelTask(i18n("Unknown collection mimetype"));
}
checkTokenRefresh();
// checkTokenRefresh();
}
AKONADI_RESOURCE_MAIN(EteSyncResource)
......@@ -36,8 +36,9 @@ class EteSyncResource : public Akonadi::ResourceBase,
public: