summaryrefslogtreecommitdiffstats
path: root/common/sourcewriteback.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-07-27 02:26:47 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-09-15 16:14:19 +0200
commit26816c21f60450e461a5b6ef4ef740f6070ce278 (patch)
tree55e8aee03e094abf702438e6cd26233047345e70 /common/sourcewriteback.cpp
parent9a9bb39f7641a818434cafa0dae0c8aa47124c0b (diff)
downloadsink-26816c21f60450e461a5b6ef4ef740f6070ce278.tar.gz
sink-26816c21f60450e461a5b6ef4ef740f6070ce278.zip
Ported to the kasync revamp
Diffstat (limited to 'common/sourcewriteback.cpp')
-rw-r--r--common/sourcewriteback.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/common/sourcewriteback.cpp b/common/sourcewriteback.cpp
index fe996cb..702d8e3 100644
--- a/common/sourcewriteback.cpp
+++ b/common/sourcewriteback.cpp
@@ -106,7 +106,7 @@ KAsync::Job<void> SourceWriteBack::replay(const QByteArray &type, const QByteArr
106 job = replay(mail, operation, oldRemoteId, modifiedProperties); 106 job = replay(mail, operation, oldRemoteId, modifiedProperties);
107 } 107 }
108 108
109 return job.then<void, QByteArray>([this, operation, type, uid, oldRemoteId](const QByteArray &remoteId) { 109 return job.syncThen<void, QByteArray>([this, operation, type, uid, oldRemoteId](const QByteArray &remoteId) {
110 if (operation == Sink::Operation_Creation) { 110 if (operation == Sink::Operation_Creation) {
111 SinkTrace() << "Replayed creation with remote id: " << remoteId; 111 SinkTrace() << "Replayed creation with remote id: " << remoteId;
112 if (remoteId.isEmpty()) { 112 if (remoteId.isEmpty()) {
@@ -127,13 +127,11 @@ KAsync::Job<void> SourceWriteBack::replay(const QByteArray &type, const QByteArr
127 } else { 127 } else {
128 SinkError() << "Unkown operation" << operation; 128 SinkError() << "Unkown operation" << operation;
129 } 129 }
130 130 })
131 mSyncStore.clear(); 131 .syncThen<void>([this](const KAsync::Error &error) {
132 mEntityStore.clear(); 132 if (error) {
133 mTransaction.abort(); 133 SinkWarning() << "Failed to replay change: " << error.errorMessage;
134 mSyncTransaction.commit(); 134 }
135 }, [this](int errorCode, const QString &errorMessage) {
136 SinkWarning() << "Failed to replay change: " << errorMessage;
137 mSyncStore.clear(); 135 mSyncStore.clear();
138 mEntityStore.clear(); 136 mEntityStore.clear();
139 mTransaction.abort(); 137 mTransaction.abort();