diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-12-10 11:14:04 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-12-10 11:14:04 +0100 |
commit | 382150ca27b03b912b43ad07956231497d35cfe8 (patch) | |
tree | fa84c709446b18ae527fbcefc0cd4381544c9486 /common | |
parent | 49b1c5c3b342a84ec71e9b7dfd06a80b6d6e6c96 (diff) | |
download | sink-382150ca27b03b912b43ad07956231497d35cfe8.tar.gz sink-382150ca27b03b912b43ad07956231497d35cfe8.zip |
A change-replay function
Diffstat (limited to 'common')
-rw-r--r-- | common/genericresource.cpp | 9 | ||||
-rw-r--r-- | common/genericresource.h | 1 |
2 files changed, 8 insertions, 2 deletions
diff --git a/common/genericresource.cpp b/common/genericresource.cpp index 66f5dcf..7b8d9bb 100644 --- a/common/genericresource.cpp +++ b/common/genericresource.cpp | |||
@@ -266,8 +266,8 @@ GenericResource::GenericResource(const QByteArray &resourceInstanceIdentifier, c | |||
266 | mProcessor = new Processor(mPipeline.data(), QList<MessageQueue*>() << &mUserQueue << &mSynchronizerQueue); | 266 | mProcessor = new Processor(mPipeline.data(), QList<MessageQueue*>() << &mUserQueue << &mSynchronizerQueue); |
267 | QObject::connect(mProcessor, &Processor::error, [this](int errorCode, const QString &msg) { onProcessorError(errorCode, msg); }); | 267 | QObject::connect(mProcessor, &Processor::error, [this](int errorCode, const QString &msg) { onProcessorError(errorCode, msg); }); |
268 | QObject::connect(mPipeline.data(), &Pipeline::revisionUpdated, this, &Resource::revisionUpdated); | 268 | QObject::connect(mPipeline.data(), &Pipeline::revisionUpdated, this, &Resource::revisionUpdated); |
269 | mSourceChangeReplay = new ChangeReplay(resourceInstanceIdentifier, [](const QByteArray &type, const QByteArray &key, const QByteArray &value) { | 269 | mSourceChangeReplay = new ChangeReplay(resourceInstanceIdentifier, [this](const QByteArray &type, const QByteArray &key, const QByteArray &value) { |
270 | return KAsync::null<void>(); | 270 | return this->replay(type, key, value); |
271 | }); | 271 | }); |
272 | QObject::connect(mPipeline.data(), &Pipeline::revisionUpdated, mSourceChangeReplay, &ChangeReplay::revisionChanged); | 272 | QObject::connect(mPipeline.data(), &Pipeline::revisionUpdated, mSourceChangeReplay, &ChangeReplay::revisionChanged); |
273 | QObject::connect(mSourceChangeReplay, &ChangeReplay::changesReplayed, this, &GenericResource::updateLowerBoundRevision); | 273 | QObject::connect(mSourceChangeReplay, &ChangeReplay::changesReplayed, this, &GenericResource::updateLowerBoundRevision); |
@@ -285,6 +285,11 @@ GenericResource::~GenericResource() | |||
285 | delete mSourceChangeReplay; | 285 | delete mSourceChangeReplay; |
286 | } | 286 | } |
287 | 287 | ||
288 | KAsync::Job<void> GenericResource::replay(const QByteArray &type, const QByteArray &key, const QByteArray &value) | ||
289 | { | ||
290 | return KAsync::null<void>(); | ||
291 | } | ||
292 | |||
288 | void GenericResource::removeFromDisk(const QByteArray &instanceIdentifier) | 293 | void GenericResource::removeFromDisk(const QByteArray &instanceIdentifier) |
289 | { | 294 | { |
290 | Akonadi2::Storage(Akonadi2::storageLocation(), instanceIdentifier, Akonadi2::Storage::ReadWrite).removeFromDisk(); | 295 | Akonadi2::Storage(Akonadi2::storageLocation(), instanceIdentifier, Akonadi2::Storage::ReadWrite).removeFromDisk(); |
diff --git a/common/genericresource.h b/common/genericresource.h index 33de0e7..97251a9 100644 --- a/common/genericresource.h +++ b/common/genericresource.h | |||
@@ -53,6 +53,7 @@ private Q_SLOTS: | |||
53 | void updateLowerBoundRevision(); | 53 | void updateLowerBoundRevision(); |
54 | 54 | ||
55 | protected: | 55 | protected: |
56 | virtual KAsync::Job<void> replay(const QByteArray &type, const QByteArray &key, const QByteArray &value); | ||
56 | void onProcessorError(int errorCode, const QString &errorMessage); | 57 | void onProcessorError(int errorCode, const QString &errorMessage); |
57 | void enqueueCommand(MessageQueue &mq, int commandId, const QByteArray &data); | 58 | void enqueueCommand(MessageQueue &mq, int commandId, const QByteArray &data); |
58 | flatbuffers::FlatBufferBuilder m_fbb; | 59 | flatbuffers::FlatBufferBuilder m_fbb; |