From 4067462b0a27984df84b0379c19122d574253dfb Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sat, 3 Jan 2015 00:08:44 +0100 Subject: Shared domain adaptors between resource and facade. --- dummyresource/resourcefactory.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'dummyresource/resourcefactory.cpp') diff --git a/dummyresource/resourcefactory.cpp b/dummyresource/resourcefactory.cpp index 08222c0..da6969a 100644 --- a/dummyresource/resourcefactory.cpp +++ b/dummyresource/resourcefactory.cpp @@ -23,6 +23,7 @@ #include "pipeline.h" #include "dummycalendar_generated.h" #include "metadata_generated.h" +#include "domainadaptor.h" #include /* @@ -101,14 +102,13 @@ DummyResource::DummyResource() void DummyResource::configurePipeline(Akonadi2::Pipeline *pipeline) { + auto factory = QSharedPointer::create(); //TODO setup preprocessors for each domain type and pipeline type allowing full customization //Eventually the order should be self configuring, for now it's hardcoded. - auto eventIndexer = new SimpleProcessor([](const Akonadi2::PipelineState &state) { - //FIXME - // auto adaptor = QSharedPointer::create(); - // adaptor->mLocalBuffer = localBuffer; - // adaptor->mResourceBuffer = resourceBuffer; - // adaptor->storage = storage; + auto eventIndexer = new SimpleProcessor([factory](const Akonadi2::PipelineState &state) { + auto adaptor = factory->createAdaptor(state.entity()); + //Here we can plug in generic preprocessors + qDebug() << adaptor->getProperty("summary").toString(); }); pipeline->setPreprocessors(Akonadi2::Pipeline::NewPipeline, QVector() << eventIndexer); } -- cgit v1.2.3