summaryrefslogtreecommitdiffstats
path: root/common/genericresource.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/genericresource.cpp')
-rw-r--r--common/genericresource.cpp20
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
373KAsync::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
388KAsync::Job<void> GenericResource::synchronizeWithSource(Akonadi2::Storage &mainStore, Akonadi2::Storage &synchronizationStore)
389{
390 return KAsync::null<void>();
391}
392
373static void waitForDrained(KAsync::Future<void> &f, MessageQueue &queue) 393static void waitForDrained(KAsync::Future<void> &f, MessageQueue &queue)
374{ 394{
375 if (queue.isEmpty()) { 395 if (queue.isEmpty()) {