diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-12-30 09:32:52 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-12-30 09:32:52 +0100 |
commit | 02c311e38b8b9b80814a4e8e582d5c5a56a51056 (patch) | |
tree | 914255d577be2f17501c546e6d08b80aa23ca165 /common/genericresource.cpp | |
parent | e99453c21eb9100d6fe05ccec153fe6e640bb440 (diff) | |
download | sink-02c311e38b8b9b80814a4e8e582d5c5a56a51056.tar.gz sink-02c311e38b8b9b80814a4e8e582d5c5a56a51056.zip |
Don't expose enabling/disabling of changerecording to resource
implementations
Diffstat (limited to 'common/genericresource.cpp')
-rw-r--r-- | common/genericresource.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/common/genericresource.cpp b/common/genericresource.cpp index 1af9226..9fbcaaa 100644 --- a/common/genericresource.cpp +++ b/common/genericresource.cpp | |||
@@ -370,6 +370,26 @@ void GenericResource::processCommand(int commandId, const QByteArray &data) | |||
370 | } | 370 | } |
371 | } | 371 | } |
372 | 372 | ||
373 | KAsync::Job<void> GenericResource::synchronizeWithSource() | ||
374 | { | ||
375 | return KAsync::start<void>([this]() { | ||
376 | Log() << " Synchronizing"; | ||
377 | //Changereplay would deadlock otherwise when trying to open the synchronization store | ||
378 | enableChangeReplay(false); | ||
379 | auto mainStore = QSharedPointer<Akonadi2::Storage>::create(Akonadi2::storageLocation(), mResourceInstanceIdentifier, Akonadi2::Storage::ReadOnly); | ||
380 | auto syncStore = QSharedPointer<Akonadi2::Storage>::create(Akonadi2::storageLocation(), mResourceInstanceIdentifier + ".synchronization", Akonadi2::Storage::ReadWrite); | ||
381 | synchronizeWithSource(*mainStore, *syncStore).then<void>([this, mainStore, syncStore]() { | ||
382 | Log() << "Done Synchronizing"; | ||
383 | enableChangeReplay(true); | ||
384 | }).exec(); | ||
385 | }); | ||
386 | } | ||
387 | |||
388 | KAsync::Job<void> GenericResource::synchronizeWithSource(Akonadi2::Storage &mainStore, Akonadi2::Storage &synchronizationStore) | ||
389 | { | ||
390 | return KAsync::null<void>(); | ||
391 | } | ||
392 | |||
373 | static void waitForDrained(KAsync::Future<void> &f, MessageQueue &queue) | 393 | static void waitForDrained(KAsync::Future<void> &f, MessageQueue &queue) |
374 | { | 394 | { |
375 | if (queue.isEmpty()) { | 395 | if (queue.isEmpty()) { |