diff options
Diffstat (limited to 'common/synchronizer.cpp')
-rw-r--r-- | common/synchronizer.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/common/synchronizer.cpp b/common/synchronizer.cpp index cf50b0b..1374d00 100644 --- a/common/synchronizer.cpp +++ b/common/synchronizer.cpp | |||
@@ -240,24 +240,26 @@ void Synchronizer::modify(const DomainType &entity) | |||
240 | KAsync::Job<void> Synchronizer::synchronize() | 240 | KAsync::Job<void> Synchronizer::synchronize() |
241 | { | 241 | { |
242 | Trace() << "Synchronizing"; | 242 | Trace() << "Synchronizing"; |
243 | mSyncInProgress = true; | ||
243 | mMessageQueue->startTransaction(); | 244 | mMessageQueue->startTransaction(); |
244 | return synchronizeWithSource().then<void>([this]() { | 245 | return synchronizeWithSource().then<void>([this]() { |
245 | mSyncStore.clear(); | 246 | mSyncStore.clear(); |
246 | mEntityStore.clear(); | 247 | mEntityStore.clear(); |
247 | mMessageQueue->commit(); | 248 | mMessageQueue->commit(); |
249 | mSyncInProgress = false; | ||
248 | }); | 250 | }); |
249 | } | 251 | } |
250 | 252 | ||
251 | void Synchronizer::commit() | 253 | void Synchronizer::commit() |
252 | { | 254 | { |
255 | mMessageQueue->commit(); | ||
253 | mTransaction.abort(); | 256 | mTransaction.abort(); |
254 | mEntityStore.clear(); | 257 | mEntityStore.clear(); |
255 | } | ||
256 | |||
257 | void Synchronizer::commitSync() | ||
258 | { | ||
259 | mSyncTransaction.commit(); | 258 | mSyncTransaction.commit(); |
260 | mSyncStore.clear(); | 259 | mSyncStore.clear(); |
260 | if (mSyncInProgress) { | ||
261 | mMessageQueue->startTransaction(); | ||
262 | } | ||
261 | } | 263 | } |
262 | 264 | ||
263 | Sink::Storage::Transaction &Synchronizer::transaction() | 265 | Sink::Storage::Transaction &Synchronizer::transaction() |