diff options
Diffstat (limited to 'common/pipeline.cpp')
-rw-r--r-- | common/pipeline.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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<qint64> Pipeline::modifiedEntity(void const *command, size_t size) | |||
220 | } | 220 | } |
221 | } | 221 | } |
222 | 222 | ||
223 | //TODO use only readPropertyMapper and writePropertyMapper | ||
223 | auto adaptorFactory = d->adaptorFactory.value(bufferType); | 224 | auto adaptorFactory = d->adaptorFactory.value(bufferType); |
224 | if (!adaptorFactory) { | 225 | if (!adaptorFactory) { |
225 | Warning() << "no adaptor factory for type " << bufferType; | 226 | Warning() << "no adaptor factory for type " << bufferType; |
@@ -255,6 +256,7 @@ KAsync::Job<qint64> Pipeline::modifiedEntity(void const *command, size_t size) | |||
255 | 256 | ||
256 | //Apply diff | 257 | //Apply diff |
257 | //FIXME only apply the properties that are available in the buffer | 258 | //FIXME only apply the properties that are available in the buffer |
259 | Trace() << "Applying changed properties: " << diff->availableProperties(); | ||
258 | for (const auto &property : diff->availableProperties()) { | 260 | for (const auto &property : diff->availableProperties()) { |
259 | newObject->setProperty(property, diff->getProperty(property)); | 261 | newObject->setProperty(property, diff->getProperty(property)); |
260 | } | 262 | } |
@@ -277,7 +279,6 @@ KAsync::Job<qint64> Pipeline::modifiedEntity(void const *command, size_t size) | |||
277 | flatbuffers::FlatBufferBuilder fbb; | 279 | flatbuffers::FlatBufferBuilder fbb; |
278 | adaptorFactory->createBuffer(*newObject, fbb, metadataFbb.GetBufferPointer(), metadataFbb.GetSize()); | 280 | adaptorFactory->createBuffer(*newObject, fbb, metadataFbb.GetBufferPointer(), metadataFbb.GetSize()); |
279 | 281 | ||
280 | //TODO don't overwrite the old entry, but instead store a new revision | ||
281 | d->transaction.openDatabase(bufferType + ".main").write(Akonadi2::Storage::assembleKey(key, newRevision), QByteArray::fromRawData(reinterpret_cast<char const *>(fbb.GetBufferPointer()), fbb.GetSize())); | 282 | d->transaction.openDatabase(bufferType + ".main").write(Akonadi2::Storage::assembleKey(key, newRevision), QByteArray::fromRawData(reinterpret_cast<char const *>(fbb.GetBufferPointer()), fbb.GetSize())); |
282 | Akonadi2::Storage::setMaxRevision(d->transaction, newRevision); | 283 | Akonadi2::Storage::setMaxRevision(d->transaction, newRevision); |
283 | Akonadi2::Storage::recordRevision(d->transaction, newRevision, key, bufferType); | 284 | Akonadi2::Storage::recordRevision(d->transaction, newRevision, key, bufferType); |