summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2015-07-09 23:45:38 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2015-07-09 23:45:38 +0200
commit5d31ad5cc706ed1ad69df13750e7003481719aae (patch)
tree06c39546596bb813d2cfec9817bf69fff5e947a4
parentdabd1edc1e595e1edefe7fcde903aee64a1ee585 (diff)
downloadsink-5d31ad5cc706ed1ad69df13750e7003481719aae.tar.gz
sink-5d31ad5cc706ed1ad69df13750e7003481719aae.zip
cleanup
-rw-r--r--examples/dummyresource/domainadaptor.cpp2
-rw-r--r--examples/dummyresource/resourcefactory.cpp13
2 files changed, 7 insertions, 8 deletions
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 @@
1/* 1/*
2 * Copyright (C) 2015 Christian Mollekopf <chrigi_1@fastmail.fm> 2 * Copyright (C) 2015 Christian Mollekopf <chrigi_1@fastmail.fm>
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by 5 * 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 @@
1/* 1/*
2 * Copyright (C) 2014 Aaron Seigo <aseigo@kde.org> 2 * Copyright (C) 2014 Aaron Seigo <aseigo@kde.org>
3 * Copyright (C) 2015 Christian Mollekopf <chrigi_1@fastmail.fm>
3 * 4 *
4 * This program is free software; you can redistribute it and/or modify 5 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by 6 * it under the terms of the GNU General Public License as published by
@@ -22,18 +23,17 @@
22#include "entitybuffer.h" 23#include "entitybuffer.h"
23#include "pipeline.h" 24#include "pipeline.h"
24#include "dummycalendar_generated.h" 25#include "dummycalendar_generated.h"
25#include "metadata_generated.h"
26#include "queuedcommand_generated.h" 26#include "queuedcommand_generated.h"
27#include "createentity_generated.h" 27#include "createentity_generated.h"
28#include "domainadaptor.h" 28#include "domainadaptor.h"
29#include "commands.h" 29#include "commands.h"
30#include "clientapi.h"
31#include "index.h" 30#include "index.h"
32#include "log.h" 31#include "log.h"
33#include "domain/event.h" 32#include "domain/event.h"
34#include "dummystore.h" 33#include "dummystore.h"
35#include <QUuid>
36 34
35//This is the resources entity type, and not the domain type
36#define ENTITY_TYPE_EVENT "event"
37 37
38DummyResource::DummyResource(const QByteArray &instanceIdentifier) 38DummyResource::DummyResource(const QByteArray &instanceIdentifier)
39 : Akonadi2::GenericResource(instanceIdentifier) 39 : Akonadi2::GenericResource(instanceIdentifier)
@@ -57,8 +57,7 @@ void DummyResource::configurePipeline(Akonadi2::Pipeline *pipeline)
57 } 57 }
58 }); 58 });
59 59
60 //event is the entitytype and not the domain type 60 pipeline->setPreprocessors(ENTITY_TYPE_EVENT, Akonadi2::Pipeline::NewPipeline, QVector<Akonadi2::Preprocessor*>() << eventIndexer);
61 pipeline->setPreprocessors("event", Akonadi2::Pipeline::NewPipeline, QVector<Akonadi2::Preprocessor*>() << eventIndexer);
62 //TODO cleanup indexes during removal 61 //TODO cleanup indexes during removal
63 GenericResource::configurePipeline(pipeline); 62 GenericResource::configurePipeline(pipeline);
64} 63}
@@ -107,7 +106,7 @@ KAsync::Job<void> DummyResource::synchronizeWithSource(Akonadi2::Pipeline *pipel
107 106
108 flatbuffers::FlatBufferBuilder fbb; 107 flatbuffers::FlatBufferBuilder fbb;
109 //This is the resource type and not the domain type 108 //This is the resource type and not the domain type
110 auto type = fbb.CreateString("event"); 109 auto type = fbb.CreateString(ENTITY_TYPE_EVENT);
111 auto delta = Akonadi2::EntityBuffer::appendAsVector(fbb, entityFbb.GetBufferPointer(), entityFbb.GetSize()); 110 auto delta = Akonadi2::EntityBuffer::appendAsVector(fbb, entityFbb.GetBufferPointer(), entityFbb.GetSize());
112 auto location = Akonadi2::Commands::CreateCreateEntity(fbb, type, delta); 111 auto location = Akonadi2::Commands::CreateCreateEntity(fbb, type, delta);
113 Akonadi2::Commands::FinishCreateEntityBuffer(fbb, location); 112 Akonadi2::Commands::FinishCreateEntityBuffer(fbb, location);