From 26816c21f60450e461a5b6ef4ef740f6070ce278 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 27 Jul 2016 02:26:47 +0200 Subject: Ported to the kasync revamp --- examples/maildirresource/maildirresource.cpp | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'examples/maildirresource') diff --git a/examples/maildirresource/maildirresource.cpp b/examples/maildirresource/maildirresource.cpp index 392b422..e69d822 100644 --- a/examples/maildirresource/maildirresource.cpp +++ b/examples/maildirresource/maildirresource.cpp @@ -367,7 +367,7 @@ public: KAsync::Job synchronizeWithSource() Q_DECL_OVERRIDE { SinkLog() << " Synchronizing"; - return KAsync::start >([this]() { + return KAsync::start([this]() { KPIM::Maildir maildir(mMaildirPath, true); if (!maildir.isValid(false)) { return KAsync::error(1, "Maildir path doesn't point to a valid maildir: " + mMaildirPath); @@ -402,18 +402,14 @@ public: if (operation == Sink::Operation_Creation) { const auto remoteId = getFilePathFromMimeMessagePath(mail.getMimeMessagePath()); SinkTrace() << "Mail created: " << remoteId; - return KAsync::start([=]() -> QByteArray { - return remoteId.toUtf8(); - }); + return KAsync::value(remoteId.toUtf8()); } else if (operation == Sink::Operation_Removal) { SinkTrace() << "Removing a mail: " << oldRemoteId; return KAsync::null(); } else if (operation == Sink::Operation_Modification) { SinkTrace() << "Modifying a mail: " << oldRemoteId; const auto remoteId = getFilePathFromMimeMessagePath(mail.getMimeMessagePath()); - return KAsync::start([=]() -> QByteArray { - return remoteId.toUtf8(); - }); + return KAsync::value(remoteId.toUtf8()); } return KAsync::null(); } @@ -427,9 +423,7 @@ public: SinkTrace() << "Creating a new folder: " << path; KPIM::Maildir maildir(path, false); maildir.create(); - return KAsync::start([=]() -> QByteArray { - return path.toUtf8(); - }); + return KAsync::value(path.toUtf8()); } else if (operation == Sink::Operation_Removal) { const auto path = oldRemoteId; SinkTrace() << "Removing a folder: " << path; @@ -438,9 +432,7 @@ public: return KAsync::null(); } else if (operation == Sink::Operation_Modification) { SinkWarning() << "Folder modifications are not implemented"; - return KAsync::start([=]() -> QByteArray { - return oldRemoteId; - }); + return KAsync::value(oldRemoteId); } return KAsync::null(); } -- cgit v1.2.3