summaryrefslogtreecommitdiffstats
path: root/examples/imapresource/imapresource.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/imapresource/imapresource.cpp')
-rw-r--r--examples/imapresource/imapresource.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/examples/imapresource/imapresource.cpp b/examples/imapresource/imapresource.cpp
index 077795a..eef0de0 100644
--- a/examples/imapresource/imapresource.cpp
+++ b/examples/imapresource/imapresource.cpp
@@ -554,6 +554,10 @@ public:
554 return KAsync::value(folders) 554 return KAsync::value(folders)
555 .serialEach<void>([=](const Folder &folder) { 555 .serialEach<void>([=](const Folder &folder) {
556 SinkLog() << "Syncing folder " << folder.path(); 556 SinkLog() << "Syncing folder " << folder.path();
557 //Emit notification that the folder is being synced.
558 //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.
559 const auto folderLocalId = syncStore().resolveRemoteId(ENTITY_TYPE_FOLDER, folderRid(folder));
560 emitNotification(Notification::Info, ApplicationDomain::SyncInProgress, {}, {}, {folderLocalId});
557 QDate dateFilter; 561 QDate dateFilter;
558 auto filter = query.getFilter<ApplicationDomain::Mail::Date>(); 562 auto filter = query.getFilter<ApplicationDomain::Mail::Date>();
559 if (filter.value.canConvert<QDate>()) { 563 if (filter.value.canConvert<QDate>()) {
@@ -561,8 +565,13 @@ public:
561 SinkLog() << " with date-range " << dateFilter; 565 SinkLog() << " with date-range " << dateFilter;
562 } 566 }
563 return synchronizeFolder(imap, folder, dateFilter, syncHeaders) 567 return synchronizeFolder(imap, folder, dateFilter, syncHeaders)
564 .onError([folder](const KAsync::Error &error) { 568 .then([=](const KAsync::Error &error) {
565 SinkWarning() << "Failed to sync folder: " << folder.path() << "Error: " << error.errorMessage; 569 if (error) {
570 SinkWarning() << "Failed to sync folder: " << folder.path() << "Error: " << error.errorMessage;
571 emitNotification(Notification::Info, ApplicationDomain::SyncError, {}, {}, {folderLocalId});
572 } else {
573 emitNotification(Notification::Info, ApplicationDomain::SyncSuccess, {}, {}, {folderLocalId});
574 }
566 }); 575 });
567 }); 576 });
568 }); 577 });