summaryrefslogtreecommitdiffstats
path: root/common/pipeline.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/pipeline.cpp')
-rw-r--r--common/pipeline.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/common/pipeline.cpp b/common/pipeline.cpp
index ce4ad41..c5e36ee 100644
--- a/common/pipeline.cpp
+++ b/common/pipeline.cpp
@@ -441,18 +441,8 @@ void PipelineState::step()
441 d->idle = false; 441 d->idle = false;
442 if (d->filterIt.hasNext()) { 442 if (d->filterIt.hasNext()) {
443 //TODO skip step if already processed 443 //TODO skip step if already processed
444 //FIXME error handling if no result is found
445 auto preprocessor = d->filterIt.next(); 444 auto preprocessor = d->filterIt.next();
446 //FIXME this read should not be necessary 445 preprocessor->process(*this, d->pipeline->transaction());
447 //Perhaps simply use entity that is initially stored and synchronously process all filters. (Making the first filter somewhat redundant)
448 d->pipeline->transaction().scan(d->key, [this, preprocessor](const QByteArray &key, const QByteArray &value) -> bool {
449 auto entity = Akonadi2::GetEntity(value);
450 preprocessor->process(*this, *entity);
451 return false;
452 }, [this](const Akonadi2::Storage::Error &error) {
453 ErrorMsg() << "Failed to find value in pipeline: " << error.message;
454 d->pipeline->pipelineCompleted(*this);
455 });
456 } else { 446 } else {
457 //This object becomes invalid after this call 447 //This object becomes invalid after this call
458 d->pipeline->pipelineCompleted(*this); 448 d->pipeline->pipelineCompleted(*this);
@@ -483,7 +473,7 @@ Preprocessor::~Preprocessor()
483{ 473{
484} 474}
485 475
486void Preprocessor::process(const PipelineState &state, const Akonadi2::Entity &) 476void Preprocessor::process(const PipelineState &state, Akonadi2::Storage::Transaction &transaction)
487{ 477{
488 processingCompleted(state); 478 processingCompleted(state);
489} 479}