diff options
Diffstat (limited to 'common/sourcewriteback.cpp')
-rw-r--r-- | common/sourcewriteback.cpp | 14 |
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(); |