From 4bc39b1b771aaf9ae5f7c96aeaddb06f2bd101ac Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 4 May 2017 17:33:32 +0200 Subject: Fixed folder sync When explicitly listing the folder we can't rely on the subscription state, nor should we. --- examples/imapresource/imapresource.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'examples') diff --git a/examples/imapresource/imapresource.cpp b/examples/imapresource/imapresource.cpp index 5aa18dd..e7458f6 100644 --- a/examples/imapresource/imapresource.cpp +++ b/examples/imapresource/imapresource.cpp @@ -492,7 +492,7 @@ public: //Otherwise fetch full payload for daterange auto folderList = QSharedPointer>::create(); return imap->fetchFolders([folderList](const Folder &folder) { - if (!folder.noselect) { + if (!folder.noselect && folder.subscribed) { *folderList << folder; } }) @@ -580,14 +580,7 @@ public: bool syncHeaders = query.hasFilter(); //FIXME If we were able to to flush in between we could just query the local store for the folder list. return getFolderList(imap, query) - .then([=] (const QVector &folders) { - //Synchronize folders - return KAsync::value(folders) .serialEach([=](const Folder &folder) { - //Skip unsubscribed folders - if (!folder.subscribed) { - return KAsync::null(); - } SinkLog() << "Syncing folder " << folder.path(); //Emit notification that the folder is being synced. //The synchronizer can't do that because it has no concept of the folder filter on a mail sync scope meaning that the folder is being synchronized. @@ -602,7 +595,6 @@ public: SinkWarning() << "Failed to sync folder: " << folder.path() << "Error: " << error.errorMessage; }); }); - }); } }) .then([=] (const KAsync::Error &error) { -- cgit v1.2.3