From dabd1edc1e595e1edefe7fcde903aee64a1ee585 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 9 Jul 2015 23:37:07 +0200 Subject: Read-only transaction during sync. --- examples/dummyresource/resourcefactory.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/dummyresource/resourcefactory.cpp b/examples/dummyresource/resourcefactory.cpp index e61881e..73af70a 100644 --- a/examples/dummyresource/resourcefactory.cpp +++ b/examples/dummyresource/resourcefactory.cpp @@ -66,8 +66,8 @@ void DummyResource::configurePipeline(Akonadi2::Pipeline *pipeline) KAsync::Job DummyResource::synchronizeWithSource(Akonadi2::Pipeline *pipeline) { return KAsync::start([this, pipeline](KAsync::Future &f) { - //TODO use a read-only transaction during the complete sync to sync against a defined revision auto storage = QSharedPointer::create(Akonadi2::Store::storageLocation(), mResourceInstanceIdentifier); + storage->startTransaction(Akonadi2::Storage::ReadOnly); Index uidIndex(Akonadi2::Store::storageLocation(), mResourceInstanceIdentifier + ".index.uid", Akonadi2::Storage::ReadOnly); @@ -117,6 +117,7 @@ KAsync::Job DummyResource::synchronizeWithSource(Akonadi2::Pipeline *pipel //TODO diff and create modification if necessary } } + storage->abortTransaction(); //TODO find items to remove f.setFinished(); }); -- cgit v1.2.3