diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-12-30 18:01:58 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-12-30 18:01:58 +0100 |
commit | ecc2a18e1afc1b99df6725066c9ae552d09e90d8 (patch) | |
tree | c897f73483a1622d5e4f18c5cdbff55573881d93 /common/genericresource.cpp | |
parent | 84957496800a862aa88bb2e88da0a9b2c4e19dc2 (diff) | |
download | sink-ecc2a18e1afc1b99df6725066c9ae552d09e90d8.tar.gz sink-ecc2a18e1afc1b99df6725066c9ae552d09e90d8.zip |
Centralize where we create the stores
Diffstat (limited to 'common/genericresource.cpp')
-rw-r--r-- | common/genericresource.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/common/genericresource.cpp b/common/genericresource.cpp index 42153ec..29acce4 100644 --- a/common/genericresource.cpp +++ b/common/genericresource.cpp | |||
@@ -282,7 +282,9 @@ GenericResource::GenericResource(const QByteArray &resourceInstanceIdentifier, c | |||
282 | QObject::connect(mProcessor, &CommandProcessor::error, [this](int errorCode, const QString &msg) { onProcessorError(errorCode, msg); }); | 282 | QObject::connect(mProcessor, &CommandProcessor::error, [this](int errorCode, const QString &msg) { onProcessorError(errorCode, msg); }); |
283 | QObject::connect(mPipeline.data(), &Pipeline::revisionUpdated, this, &Resource::revisionUpdated); | 283 | QObject::connect(mPipeline.data(), &Pipeline::revisionUpdated, this, &Resource::revisionUpdated); |
284 | mSourceChangeReplay = new ChangeReplay(resourceInstanceIdentifier, [this](const QByteArray &type, const QByteArray &key, const QByteArray &value) { | 284 | mSourceChangeReplay = new ChangeReplay(resourceInstanceIdentifier, [this](const QByteArray &type, const QByteArray &key, const QByteArray &value) { |
285 | return this->replay(type, key, value); | 285 | //This results in a deadlock when a sync is in progress and we try to create a second writing transaction (which is why we turn changereplay off during the sync) |
286 | auto synchronizationStore = QSharedPointer<Akonadi2::Storage>::create(Akonadi2::storageLocation(), mResourceInstanceIdentifier + ".synchronization", Akonadi2::Storage::ReadWrite); | ||
287 | return this->replay(*synchronizationStore, type, key, value).then<void>([synchronizationStore](){}); | ||
286 | }); | 288 | }); |
287 | enableChangeReplay(true); | 289 | enableChangeReplay(true); |
288 | mClientLowerBoundRevision = mPipeline->cleanedUpRevision(); | 290 | mClientLowerBoundRevision = mPipeline->cleanedUpRevision(); |
@@ -317,7 +319,7 @@ void GenericResource::addType(const QByteArray &type, DomainTypeAdaptorFactoryIn | |||
317 | mPipeline->setAdaptorFactory(type, factory); | 319 | mPipeline->setAdaptorFactory(type, factory); |
318 | } | 320 | } |
319 | 321 | ||
320 | KAsync::Job<void> GenericResource::replay(const QByteArray &type, const QByteArray &key, const QByteArray &value) | 322 | KAsync::Job<void> GenericResource::replay(Akonadi2::Storage &synchronizationStore, const QByteArray &type, const QByteArray &key, const QByteArray &value) |
321 | { | 323 | { |
322 | return KAsync::null<void>(); | 324 | return KAsync::null<void>(); |
323 | } | 325 | } |