From f689ad1021a7805f6f8b6a81f534b4cb9ca91f51 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 6 Oct 2015 16:19:51 +0200 Subject: Change replay So far only includes modifications and additions, removals are not yet stored as separate revisions. --- common/pipeline.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'common/pipeline.cpp') diff --git a/common/pipeline.cpp b/common/pipeline.cpp index c108540..6c75bde 100644 --- a/common/pipeline.cpp +++ b/common/pipeline.cpp @@ -220,6 +220,7 @@ KAsync::Job Pipeline::modifiedEntity(void const *command, size_t size) } } + //TODO use only readPropertyMapper and writePropertyMapper auto adaptorFactory = d->adaptorFactory.value(bufferType); if (!adaptorFactory) { Warning() << "no adaptor factory for type " << bufferType; @@ -255,6 +256,7 @@ KAsync::Job Pipeline::modifiedEntity(void const *command, size_t size) //Apply diff //FIXME only apply the properties that are available in the buffer + Trace() << "Applying changed properties: " << diff->availableProperties(); for (const auto &property : diff->availableProperties()) { newObject->setProperty(property, diff->getProperty(property)); } @@ -277,7 +279,6 @@ KAsync::Job Pipeline::modifiedEntity(void const *command, size_t size) flatbuffers::FlatBufferBuilder fbb; adaptorFactory->createBuffer(*newObject, fbb, metadataFbb.GetBufferPointer(), metadataFbb.GetSize()); - //TODO don't overwrite the old entry, but instead store a new revision d->transaction.openDatabase(bufferType + ".main").write(Akonadi2::Storage::assembleKey(key, newRevision), QByteArray::fromRawData(reinterpret_cast(fbb.GetBufferPointer()), fbb.GetSize())); Akonadi2::Storage::setMaxRevision(d->transaction, newRevision); Akonadi2::Storage::recordRevision(d->transaction, newRevision, key, bufferType); -- cgit v1.2.3