diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-07-27 02:26:47 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-09-15 16:14:19 +0200 |
commit | 26816c21f60450e461a5b6ef4ef740f6070ce278 (patch) | |
tree | 55e8aee03e094abf702438e6cd26233047345e70 /examples/mailtransportresource/mailtransportresource.cpp | |
parent | 9a9bb39f7641a818434cafa0dae0c8aa47124c0b (diff) | |
download | sink-26816c21f60450e461a5b6ef4ef740f6070ce278.tar.gz sink-26816c21f60450e461a5b6ef4ef740f6070ce278.zip |
Ported to the kasync revamp
Diffstat (limited to 'examples/mailtransportresource/mailtransportresource.cpp')
-rw-r--r-- | examples/mailtransportresource/mailtransportresource.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
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: | |||
124 | }); | 124 | }); |
125 | auto job = KAsync::null<void>(); | 125 | auto job = KAsync::null<void>(); |
126 | for (const auto &m : toSend) { | 126 | for (const auto &m : toSend) { |
127 | job = job.then(send(m, mSettings)).then<void>([this, m]() { | 127 | job = job.then(send(m, mSettings)).syncThen<void>([this, m] { |
128 | auto modifiedMail = ApplicationDomain::Mail(mResourceInstanceIdentifier, m.identifier(), m.revision(), QSharedPointer<Sink::ApplicationDomain::MemoryBufferAdaptor>::create()); | 128 | auto modifiedMail = ApplicationDomain::Mail(mResourceInstanceIdentifier, m.identifier(), m.revision(), QSharedPointer<Sink::ApplicationDomain::MemoryBufferAdaptor>::create()); |
129 | modifiedMail.setSent(true); | 129 | modifiedMail.setSent(true); |
130 | modify(modifiedMail); | 130 | modify(modifiedMail); |
131 | //TODO copy to a sent mail folder as well | 131 | //TODO copy to a sent mail folder as well |
132 | }); | 132 | }); |
133 | } | 133 | } |
134 | job = job.then<void>([&future]() { | 134 | job = job.syncThen<void>([&future](const KAsync::Error &) { |
135 | future.setFinished(); | ||
136 | }, | ||
137 | [&future](int errorCode, const QString &errorString) { | ||
138 | future.setFinished(); | 135 | future.setFinished(); |
139 | }); | 136 | }); |
140 | job.exec(); | 137 | job.exec(); |