summaryrefslogtreecommitdiffstats
path: root/common/synchronizer.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-01-12 11:45:15 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-01-12 11:45:15 +0100
commit7daeec83233c522980d5e477fee82045de57f77d (patch)
tree5e03d11d23c764eb03f27393fcc37c0529405e10 /common/synchronizer.cpp
parentaf8baff21529b5bc47725da3e9e00ec81e5b6f1b (diff)
downloadsink-7daeec83233c522980d5e477fee82045de57f77d.tar.gz
sink-7daeec83233c522980d5e477fee82045de57f77d.zip
syncThen is no longer necessary
Diffstat (limited to 'common/synchronizer.cpp')
-rw-r--r--common/synchronizer.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/common/synchronizer.cpp b/common/synchronizer.cpp
index a4e64c9..bb1a3f4 100644
--- a/common/synchronizer.cpp
+++ b/common/synchronizer.cpp
@@ -286,7 +286,7 @@ KAsync::Job<void> Synchronizer::processSyncQueue()
286 while (!mSyncRequestQueue.isEmpty()) { 286 while (!mSyncRequestQueue.isEmpty()) {
287 auto request = mSyncRequestQueue.takeFirst(); 287 auto request = mSyncRequestQueue.takeFirst();
288 if (request.requestType == Synchronizer::SyncRequest::Synchronization) { 288 if (request.requestType == Synchronizer::SyncRequest::Synchronization) {
289 job = job.syncThen<void>([this, request] { 289 job = job.then([this, request] {
290 Sink::Notification n; 290 Sink::Notification n;
291 n.id = request.requestId; 291 n.id = request.requestId;
292 n.type = Notification::Status; 292 n.type = Notification::Status;
@@ -294,7 +294,7 @@ KAsync::Job<void> Synchronizer::processSyncQueue()
294 n.code = ApplicationDomain::BusyStatus; 294 n.code = ApplicationDomain::BusyStatus;
295 emit notify(n); 295 emit notify(n);
296 SinkLogCtx(mLogCtx) << "Synchronizing " << request.query; 296 SinkLogCtx(mLogCtx) << "Synchronizing " << request.query;
297 }).then(synchronizeWithSource(request.query)).syncThen<void>([this] { 297 }).then(synchronizeWithSource(request.query)).then([this] {
298 //Commit after every request, so implementations only have to commit more if they add a lot of data. 298 //Commit after every request, so implementations only have to commit more if they add a lot of data.
299 commit(); 299 commit();
300 }).then<void>([this, request](const KAsync::Error &error) { 300 }).then<void>([this, request](const KAsync::Error &error) {
@@ -431,7 +431,7 @@ KAsync::Job<void> Synchronizer::replay(const QByteArray &type, const QByteArray
431 job = replay(mail, operation, oldRemoteId, modifiedProperties); 431 job = replay(mail, operation, oldRemoteId, modifiedProperties);
432 } 432 }
433 433
434 return job.syncThen<void, QByteArray>([this, operation, type, uid, oldRemoteId](const QByteArray &remoteId) { 434 return job.then([this, operation, type, uid, oldRemoteId](const QByteArray &remoteId) {
435 if (operation == Sink::Operation_Creation) { 435 if (operation == Sink::Operation_Creation) {
436 SinkTrace() << "Replayed creation with remote id: " << remoteId; 436 SinkTrace() << "Replayed creation with remote id: " << remoteId;
437 if (remoteId.isEmpty()) { 437 if (remoteId.isEmpty()) {
@@ -453,7 +453,7 @@ KAsync::Job<void> Synchronizer::replay(const QByteArray &type, const QByteArray
453 SinkError() << "Unkown operation" << operation; 453 SinkError() << "Unkown operation" << operation;
454 } 454 }
455 }) 455 })
456 .syncThen<void>([this](const KAsync::Error &error) { 456 .then([this](const KAsync::Error &error) {
457 if (error) { 457 if (error) {
458 SinkWarning() << "Failed to replay change: " << error.errorMessage; 458 SinkWarning() << "Failed to replay change: " << error.errorMessage;
459 } 459 }