summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2015-07-09 23:37:07 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2015-07-09 23:37:07 +0200
commitdabd1edc1e595e1edefe7fcde903aee64a1ee585 (patch)
tree8c93046621e07b33f5ca3733a98ff211bc28d501
parentc5e4f2965ee31b1966971aa6fdcad38db393014d (diff)
downloadsink-dabd1edc1e595e1edefe7fcde903aee64a1ee585.tar.gz
sink-dabd1edc1e595e1edefe7fcde903aee64a1ee585.zip
Read-only transaction during sync.
-rw-r--r--examples/dummyresource/resourcefactory.cpp3
1 files changed, 2 insertions, 1 deletions
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)
66KAsync::Job<void> DummyResource::synchronizeWithSource(Akonadi2::Pipeline *pipeline) 66KAsync::Job<void> DummyResource::synchronizeWithSource(Akonadi2::Pipeline *pipeline)
67{ 67{
68 return KAsync::start<void>([this, pipeline](KAsync::Future<void> &f) { 68 return KAsync::start<void>([this, pipeline](KAsync::Future<void> &f) {
69 //TODO use a read-only transaction during the complete sync to sync against a defined revision
70 auto storage = QSharedPointer<Akonadi2::Storage>::create(Akonadi2::Store::storageLocation(), mResourceInstanceIdentifier); 69 auto storage = QSharedPointer<Akonadi2::Storage>::create(Akonadi2::Store::storageLocation(), mResourceInstanceIdentifier);
70 storage->startTransaction(Akonadi2::Storage::ReadOnly);
71 71
72 Index uidIndex(Akonadi2::Store::storageLocation(), mResourceInstanceIdentifier + ".index.uid", Akonadi2::Storage::ReadOnly); 72 Index uidIndex(Akonadi2::Store::storageLocation(), mResourceInstanceIdentifier + ".index.uid", Akonadi2::Storage::ReadOnly);
73 73
@@ -117,6 +117,7 @@ KAsync::Job<void> DummyResource::synchronizeWithSource(Akonadi2::Pipeline *pipel
117 //TODO diff and create modification if necessary 117 //TODO diff and create modification if necessary
118 } 118 }
119 } 119 }
120 storage->abortTransaction();
120 //TODO find items to remove 121 //TODO find items to remove
121 f.setFinished(); 122 f.setFinished();
122 }); 123 });