From 1c7e8fd482bb67a5487449948488bd286a3504c1 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Wed, 17 Dec 2014 08:27:31 +0100 Subject: a basically-working Pipeline implementation still a skeleton rather than a full body with flesh and blood, but it is getting there! --- dummyresource/resourcefactory.cpp | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'dummyresource/resourcefactory.cpp') diff --git a/dummyresource/resourcefactory.cpp b/dummyresource/resourcefactory.cpp index 37bfdac..bd85b4f 100644 --- a/dummyresource/resourcefactory.cpp +++ b/dummyresource/resourcefactory.cpp @@ -19,6 +19,7 @@ #include "resourcefactory.h" #include "facade.h" +#include "dummycalendar_generated.h" DummyResource::DummyResource() : Akonadi2::Resource() @@ -26,9 +27,29 @@ DummyResource::DummyResource() } -void DummyResource::synchronizeWithSource() +void DummyResource::synchronizeWithSource(Akonadi2::Pipeline *pipeline) { - // TODO populate the storage + // TODO actually populate the storage with new items + auto builder = DummyCalendar::DummyEventBuilder(m_fbb); + builder .add_summary(m_fbb.CreateString("summary summary!")); + auto buffer = builder.Finish(); + DummyCalendar::FinishDummyEventBuffer(m_fbb, buffer); + pipeline->newEntity("fakekey", m_fbb); + m_fbb.Clear(); +} + +void DummyResource::processCommand(int commandId, const QByteArray &data, uint size, Akonadi2::Pipeline *pipeline) +{ + Q_UNUSED(commandId) + Q_UNUSED(data) + Q_UNUSED(size) + //TODO reallly process the commands :) + auto builder = DummyCalendar::DummyEventBuilder(m_fbb); + builder .add_summary(m_fbb.CreateString("summary summary!")); + auto buffer = builder.Finish(); + DummyCalendar::FinishDummyEventBuffer(m_fbb, buffer); + pipeline->newEntity("fakekey", m_fbb); + m_fbb.Clear(); } DummyResourceFactory::DummyResourceFactory(QObject *parent) -- cgit v1.2.3