summaryrefslogtreecommitdiffstats
path: root/common/pipeline.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-06-30 15:13:10 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-06-30 15:13:10 +0200
commitef9a070c10dffc346b7dee0c7714d7bda7663017 (patch)
tree9b333451c2fdd42df1dd0d6a9586bd44573fbae5 /common/pipeline.cpp
parentae20c6efd1051d48c367f97b96812f305b4d0819 (diff)
downloadsink-ef9a070c10dffc346b7dee0c7714d7bda7663017.tar.gz
sink-ef9a070c10dffc346b7dee0c7714d7bda7663017.zip
Properly track changes applied by preprocessors
This is necessary so we get the actual changeset during replay, so a mark-as-read action doesn't result in a new mime message, but only the flag change.
Diffstat (limited to 'common/pipeline.cpp')
-rw-r--r--common/pipeline.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/common/pipeline.cpp b/common/pipeline.cpp
index 976a83f..c6d5297 100644
--- a/common/pipeline.cpp
+++ b/common/pipeline.cpp
@@ -305,7 +305,7 @@ KAsync::Job<qint64> Pipeline::modifiedEntity(void const *command, size_t size)
305 305
306 // Apply diff 306 // Apply diff
307 // FIXME only apply the properties that are available in the buffer 307 // FIXME only apply the properties that are available in the buffer
308 Trace() << "Applying changed properties: " << diff->availableProperties(); 308 Trace() << "Applying changed properties: " << changeset;
309 for (const auto &property : changeset) { 309 for (const auto &property : changeset) {
310 const auto value = diff->getProperty(property); 310 const auto value = diff->getProperty(property);
311 if (value.isValid()) { 311 if (value.isValid()) {
@@ -320,6 +320,7 @@ KAsync::Job<qint64> Pipeline::modifiedEntity(void const *command, size_t size)
320 } 320 }
321 } 321 }
322 322
323 newAdaptor->resetChangedProperties();
323 for (auto processor : d->processors[bufferType]) { 324 for (auto processor : d->processors[bufferType]) {
324 processor->modifiedEntity(key, Storage::maxRevision(d->transaction) + 1, *current, *newAdaptor, d->transaction); 325 processor->modifiedEntity(key, Storage::maxRevision(d->transaction) + 1, *current, *newAdaptor, d->transaction);
325 } 326 }
@@ -330,7 +331,7 @@ KAsync::Job<qint64> Pipeline::modifiedEntity(void const *command, size_t size)
330 flatbuffers::FlatBufferBuilder metadataFbb; 331 flatbuffers::FlatBufferBuilder metadataFbb;
331 { 332 {
332 //We add availableProperties to account for the properties that have been changed by the preprocessors 333 //We add availableProperties to account for the properties that have been changed by the preprocessors
333 auto modifiedProperties = BufferUtils::toVector(metadataFbb, changeset + newAdaptor->availableProperties()); 334 auto modifiedProperties = BufferUtils::toVector(metadataFbb, changeset + newAdaptor->changedProperties());
334 auto metadataBuilder = MetadataBuilder(metadataFbb); 335 auto metadataBuilder = MetadataBuilder(metadataFbb);
335 metadataBuilder.add_revision(newRevision); 336 metadataBuilder.add_revision(newRevision);
336 metadataBuilder.add_operation(Operation_Modification); 337 metadataBuilder.add_operation(Operation_Modification);