summaryrefslogtreecommitdiffstats
path: root/examples/imapresource/imapresource.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-01-10 20:44:08 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-01-10 20:44:08 +0100
commit051a0be95cbe4fe5eb0c7431e13987a2aa56bcc0 (patch)
tree14b8400e9012da5aecfae67653e187b090bfb51c /examples/imapresource/imapresource.cpp
parent1aefcdb05bbf39d510235ba05095b35ada1ed5cb (diff)
downloadsink-051a0be95cbe4fe5eb0c7431e13987a2aa56bcc0.tar.gz
sink-051a0be95cbe4fe5eb0c7431e13987a2aa56bcc0.zip
Logout after synchronization
Diffstat (limited to 'examples/imapresource/imapresource.cpp')
-rw-r--r--examples/imapresource/imapresource.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/examples/imapresource/imapresource.cpp b/examples/imapresource/imapresource.cpp
index be8ade5..4f7b9f3 100644
--- a/examples/imapresource/imapresource.cpp
+++ b/examples/imapresource/imapresource.cpp
@@ -449,6 +449,13 @@ public:
449 commit(); 449 commit();
450 return *folderList; 450 return *folderList;
451 }); 451 });
452 })
453 .then<void>([=] (const KAsync::Error &error) {
454 if (error) {
455 SinkWarning() << "Error during sync: " << error.errorMessage;
456 }
457 return imap->logout()
458 .then(KAsync::error(error));
452 }); 459 });
453 } else if (query.type() == ApplicationDomain::getTypeName<ApplicationDomain::Mail>()) { 460 } else if (query.type() == ApplicationDomain::getTypeName<ApplicationDomain::Mail>()) {
454 //TODO 461 //TODO
@@ -513,6 +520,13 @@ public:
513 }); 520 });
514 }); 521 });
515 } 522 }
523 })
524 .then<void>([=] (const KAsync::Error &error) {
525 if (error) {
526 SinkWarning() << "Error during sync: " << error.errorMessage;
527 }
528 return imap->logout()
529 .then(KAsync::error(error));
516 }); 530 });
517 } 531 }
518 return KAsync::error<void>("Nothing to do"); 532 return KAsync::error<void>("Nothing to do");