From 5d31ad5cc706ed1ad69df13750e7003481719aae Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 9 Jul 2015 23:45:38 +0200 Subject: cleanup --- examples/dummyresource/domainadaptor.cpp | 2 +- examples/dummyresource/resourcefactory.cpp | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'examples') diff --git a/examples/dummyresource/domainadaptor.cpp b/examples/dummyresource/domainadaptor.cpp index cb54586..4cc592e 100644 --- a/examples/dummyresource/domainadaptor.cpp +++ b/examples/dummyresource/domainadaptor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 Christian Mollekopf + * Copyright (C) 2015 Christian Mollekopf * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/examples/dummyresource/resourcefactory.cpp b/examples/dummyresource/resourcefactory.cpp index 73af70a..9e8a2fc 100644 --- a/examples/dummyresource/resourcefactory.cpp +++ b/examples/dummyresource/resourcefactory.cpp @@ -1,5 +1,6 @@ /* - * Copyright (C) 2014 Aaron Seigo + * Copyright (C) 2014 Aaron Seigo + * Copyright (C) 2015 Christian Mollekopf * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,18 +23,17 @@ #include "entitybuffer.h" #include "pipeline.h" #include "dummycalendar_generated.h" -#include "metadata_generated.h" #include "queuedcommand_generated.h" #include "createentity_generated.h" #include "domainadaptor.h" #include "commands.h" -#include "clientapi.h" #include "index.h" #include "log.h" #include "domain/event.h" #include "dummystore.h" -#include +//This is the resources entity type, and not the domain type +#define ENTITY_TYPE_EVENT "event" DummyResource::DummyResource(const QByteArray &instanceIdentifier) : Akonadi2::GenericResource(instanceIdentifier) @@ -57,8 +57,7 @@ void DummyResource::configurePipeline(Akonadi2::Pipeline *pipeline) } }); - //event is the entitytype and not the domain type - pipeline->setPreprocessors("event", Akonadi2::Pipeline::NewPipeline, QVector() << eventIndexer); + pipeline->setPreprocessors(ENTITY_TYPE_EVENT, Akonadi2::Pipeline::NewPipeline, QVector() << eventIndexer); //TODO cleanup indexes during removal GenericResource::configurePipeline(pipeline); } @@ -107,7 +106,7 @@ KAsync::Job DummyResource::synchronizeWithSource(Akonadi2::Pipeline *pipel flatbuffers::FlatBufferBuilder fbb; //This is the resource type and not the domain type - auto type = fbb.CreateString("event"); + auto type = fbb.CreateString(ENTITY_TYPE_EVENT); auto delta = Akonadi2::EntityBuffer::appendAsVector(fbb, entityFbb.GetBufferPointer(), entityFbb.GetSize()); auto location = Akonadi2::Commands::CreateCreateEntity(fbb, type, delta); Akonadi2::Commands::FinishCreateEntityBuffer(fbb, location); -- cgit v1.2.3