summaryrefslogtreecommitdiffstats
path: root/examples/mailtransportresource
diff options
context:
space:
mode:
Diffstat (limited to 'examples/mailtransportresource')
-rw-r--r--examples/mailtransportresource/mailtransportresource.cpp7
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();