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/mailtransportresource/mailtransportresource.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'examples/mailtransportresource') diff --git a/examples/mailtransportresource/mailtransportresource.cpp b/examples/mailtransportresource/mailtransportresource.cpp index a729d4d..be4e4e0 100644 --- a/examples/mailtransportresource/mailtransportresource.cpp +++ b/examples/mailtransportresource/mailtransportresource.cpp @@ -124,17 +124,14 @@ public: }); auto job = KAsync::null(); for (const auto &m : toSend) { - job = job.then(send(m, mSettings)).then([this, m]() { + job = job.then(send(m, mSettings)).syncThen([this, m] { auto modifiedMail = ApplicationDomain::Mail(mResourceInstanceIdentifier, m.identifier(), m.revision(), QSharedPointer::create()); modifiedMail.setSent(true); modify(modifiedMail); //TODO copy to a sent mail folder as well }); } - job = job.then([&future]() { - future.setFinished(); - }, - [&future](int errorCode, const QString &errorString) { + job = job.syncThen([&future](const KAsync::Error &) { future.setFinished(); }); job.exec(); -- cgit v1.2.3