diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/dummyresource/domainadaptor.cpp | 6 | ||||
-rw-r--r-- | examples/dummyresource/domainadaptor.h | 9 | ||||
-rw-r--r-- | examples/dummyresource/dummystore.cpp | 33 | ||||
-rw-r--r-- | examples/dummyresource/dummystore.h | 4 | ||||
-rw-r--r-- | examples/dummyresource/facade.cpp | 8 | ||||
-rw-r--r-- | examples/dummyresource/facade.h | 7 | ||||
-rw-r--r-- | examples/dummyresource/resourcefactory.cpp | 126 | ||||
-rw-r--r-- | examples/dummyresource/resourcefactory.h | 3 |
8 files changed, 171 insertions, 25 deletions
diff --git a/examples/dummyresource/domainadaptor.cpp b/examples/dummyresource/domainadaptor.cpp index 4cc592e..d08a783 100644 --- a/examples/dummyresource/domainadaptor.cpp +++ b/examples/dummyresource/domainadaptor.cpp | |||
@@ -45,3 +45,9 @@ DummyEventAdaptorFactory::DummyEventAdaptorFactory() | |||
45 | }); | 45 | }); |
46 | } | 46 | } |
47 | 47 | ||
48 | DummyMailAdaptorFactory::DummyMailAdaptorFactory() | ||
49 | : DomainTypeAdaptorFactory() | ||
50 | { | ||
51 | |||
52 | } | ||
53 | |||
diff --git a/examples/dummyresource/domainadaptor.h b/examples/dummyresource/domainadaptor.h index 8b6d96b..add3e8e 100644 --- a/examples/dummyresource/domainadaptor.h +++ b/examples/dummyresource/domainadaptor.h | |||
@@ -20,6 +20,7 @@ | |||
20 | 20 | ||
21 | #include "common/domainadaptor.h" | 21 | #include "common/domainadaptor.h" |
22 | #include "event_generated.h" | 22 | #include "event_generated.h" |
23 | #include "mail_generated.h" | ||
23 | #include "dummycalendar_generated.h" | 24 | #include "dummycalendar_generated.h" |
24 | #include "entity_generated.h" | 25 | #include "entity_generated.h" |
25 | 26 | ||
@@ -29,3 +30,11 @@ public: | |||
29 | DummyEventAdaptorFactory(); | 30 | DummyEventAdaptorFactory(); |
30 | virtual ~DummyEventAdaptorFactory() {}; | 31 | virtual ~DummyEventAdaptorFactory() {}; |
31 | }; | 32 | }; |
33 | |||
34 | //TODO replace the resource specific event class by a mail class or a dummy class if no resource type is required. | ||
35 | class DummyMailAdaptorFactory : public DomainTypeAdaptorFactory<Akonadi2::ApplicationDomain::Mail, DummyCalendar::DummyEvent, DummyCalendar::DummyEventBuilder> | ||
36 | { | ||
37 | public: | ||
38 | DummyMailAdaptorFactory(); | ||
39 | virtual ~DummyMailAdaptorFactory() {}; | ||
40 | }; | ||
diff --git a/examples/dummyresource/dummystore.cpp b/examples/dummyresource/dummystore.cpp index 5a3f74b..41b48ed 100644 --- a/examples/dummyresource/dummystore.cpp +++ b/examples/dummyresource/dummystore.cpp | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <QString> | 21 | #include <QString> |
22 | 22 | ||
23 | #include "dummycalendar_generated.h" | 23 | #include "dummycalendar_generated.h" |
24 | #include "mail_generated.h" | ||
24 | 25 | ||
25 | static std::string createEvent(int i) | 26 | static std::string createEvent(int i) |
26 | { | 27 | { |
@@ -43,6 +44,20 @@ static std::string createEvent(int i) | |||
43 | return std::string(reinterpret_cast<const char *>(fbb.GetBufferPointer()), fbb.GetSize()); | 44 | return std::string(reinterpret_cast<const char *>(fbb.GetBufferPointer()), fbb.GetSize()); |
44 | } | 45 | } |
45 | 46 | ||
47 | static std::string createMail(int i) | ||
48 | { | ||
49 | static flatbuffers::FlatBufferBuilder fbb; | ||
50 | fbb.Clear(); | ||
51 | { | ||
52 | auto subject = fbb.CreateString("summary" + std::to_string(i)); | ||
53 | Akonadi2::ApplicationDomain::Buffer::MailBuilder mailBuilder(fbb); | ||
54 | mailBuilder.add_subject(subject); | ||
55 | Akonadi2::ApplicationDomain::Buffer::FinishMailBuffer(fbb, mailBuilder.Finish()); | ||
56 | } | ||
57 | |||
58 | return std::string(reinterpret_cast<const char *>(fbb.GetBufferPointer()), fbb.GetSize()); | ||
59 | } | ||
60 | |||
46 | QMap<QString, QString> populate() | 61 | QMap<QString, QString> populate() |
47 | { | 62 | { |
48 | QMap<QString, QString> content; | 63 | QMap<QString, QString> content; |
@@ -53,10 +68,24 @@ QMap<QString, QString> populate() | |||
53 | return content; | 68 | return content; |
54 | } | 69 | } |
55 | 70 | ||
56 | static QMap<QString, QString> s_dataSource = populate(); | 71 | QMap<QString, QString> populateMails() |
72 | { | ||
73 | QMap<QString, QString> content; | ||
74 | for (int i = 0; i < 2; i++) { | ||
75 | content.insert(QString("key%1").arg(i), QString::fromStdString(createMail(i))); | ||
76 | } | ||
77 | return content; | ||
78 | } | ||
57 | 79 | ||
80 | static QMap<QString, QString> s_dataSource = populate(); | ||
81 | static QMap<QString, QString> s_mailSource = populateMails(); | ||
58 | 82 | ||
59 | QMap<QString, QString> DummyStore::data() const | 83 | QMap<QString, QString> DummyStore::events() const |
60 | { | 84 | { |
61 | return s_dataSource; | 85 | return s_dataSource; |
62 | } | 86 | } |
87 | |||
88 | QMap<QString, QString> DummyStore::mails() const | ||
89 | { | ||
90 | return s_mailSource; | ||
91 | } | ||
diff --git a/examples/dummyresource/dummystore.h b/examples/dummyresource/dummystore.h index 6a404ae..ba1c0ae 100644 --- a/examples/dummyresource/dummystore.h +++ b/examples/dummyresource/dummystore.h | |||
@@ -29,6 +29,6 @@ public: | |||
29 | return instance; | 29 | return instance; |
30 | } | 30 | } |
31 | 31 | ||
32 | QMap<QString, QString> data() const; | 32 | QMap<QString, QString> events() const; |
33 | 33 | QMap<QString, QString> mails() const; | |
34 | }; | 34 | }; |
diff --git a/examples/dummyresource/facade.cpp b/examples/dummyresource/facade.cpp index d20d12d..63f84f2 100644 --- a/examples/dummyresource/facade.cpp +++ b/examples/dummyresource/facade.cpp | |||
@@ -30,3 +30,11 @@ DummyResourceFacade::~DummyResourceFacade() | |||
30 | { | 30 | { |
31 | } | 31 | } |
32 | 32 | ||
33 | DummyResourceMailFacade::DummyResourceMailFacade(const QByteArray &instanceIdentifier) | ||
34 | : Akonadi2::GenericFacade<Akonadi2::ApplicationDomain::Mail>(instanceIdentifier, QSharedPointer<DummyMailAdaptorFactory>::create()) | ||
35 | { | ||
36 | } | ||
37 | |||
38 | DummyResourceMailFacade::~DummyResourceMailFacade() | ||
39 | { | ||
40 | } | ||
diff --git a/examples/dummyresource/facade.h b/examples/dummyresource/facade.h index dde0dc2..87f68c3 100644 --- a/examples/dummyresource/facade.h +++ b/examples/dummyresource/facade.h | |||
@@ -28,3 +28,10 @@ public: | |||
28 | DummyResourceFacade(const QByteArray &instanceIdentifier); | 28 | DummyResourceFacade(const QByteArray &instanceIdentifier); |
29 | virtual ~DummyResourceFacade(); | 29 | virtual ~DummyResourceFacade(); |
30 | }; | 30 | }; |
31 | |||
32 | class DummyResourceMailFacade : public Akonadi2::GenericFacade<Akonadi2::ApplicationDomain::Mail> | ||
33 | { | ||
34 | public: | ||
35 | DummyResourceMailFacade(const QByteArray &instanceIdentifier); | ||
36 | virtual ~DummyResourceMailFacade(); | ||
37 | }; | ||
diff --git a/examples/dummyresource/resourcefactory.cpp b/examples/dummyresource/resourcefactory.cpp index 0e18282..8d605b9 100644 --- a/examples/dummyresource/resourcefactory.cpp +++ b/examples/dummyresource/resourcefactory.cpp | |||
@@ -23,6 +23,7 @@ | |||
23 | #include "entitybuffer.h" | 23 | #include "entitybuffer.h" |
24 | #include "pipeline.h" | 24 | #include "pipeline.h" |
25 | #include "dummycalendar_generated.h" | 25 | #include "dummycalendar_generated.h" |
26 | #include "mail_generated.h" | ||
26 | #include "queuedcommand_generated.h" | 27 | #include "queuedcommand_generated.h" |
27 | #include "createentity_generated.h" | 28 | #include "createentity_generated.h" |
28 | #include "domainadaptor.h" | 29 | #include "domainadaptor.h" |
@@ -30,21 +31,23 @@ | |||
30 | #include "index.h" | 31 | #include "index.h" |
31 | #include "log.h" | 32 | #include "log.h" |
32 | #include "domain/event.h" | 33 | #include "domain/event.h" |
34 | #include "domain/mail.h" | ||
33 | #include "dummystore.h" | 35 | #include "dummystore.h" |
34 | #include "definitions.h" | 36 | #include "definitions.h" |
35 | #include "facadefactory.h" | 37 | #include "facadefactory.h" |
36 | 38 | ||
37 | //This is the resources entity type, and not the domain type | 39 | //This is the resources entity type, and not the domain type |
38 | #define ENTITY_TYPE_EVENT "event" | 40 | #define ENTITY_TYPE_EVENT "event" |
41 | #define ENTITY_TYPE_MAIL "mail" | ||
39 | 42 | ||
40 | DummyResource::DummyResource(const QByteArray &instanceIdentifier, const QSharedPointer<Akonadi2::Pipeline> &pipeline) | 43 | DummyResource::DummyResource(const QByteArray &instanceIdentifier, const QSharedPointer<Akonadi2::Pipeline> &pipeline) |
41 | : Akonadi2::GenericResource(instanceIdentifier, pipeline) | 44 | : Akonadi2::GenericResource(instanceIdentifier, pipeline) |
42 | { | 45 | { |
43 | auto eventFactory = QSharedPointer<DummyEventAdaptorFactory>::create(); | 46 | auto eventFactory = QSharedPointer<DummyEventAdaptorFactory>::create(); |
44 | const auto resourceIdentifier = mResourceInstanceIdentifier; | 47 | const auto resourceIdentifier = mResourceInstanceIdentifier; |
48 | |||
45 | auto eventIndexer = new Akonadi2::SimpleProcessor("eventIndexer", [eventFactory, resourceIdentifier](const Akonadi2::PipelineState &state, const Akonadi2::Entity &entity, Akonadi2::Storage::Transaction &transaction) { | 49 | auto eventIndexer = new Akonadi2::SimpleProcessor("eventIndexer", [eventFactory, resourceIdentifier](const Akonadi2::PipelineState &state, const Akonadi2::Entity &entity, Akonadi2::Storage::Transaction &transaction) { |
46 | auto adaptor = eventFactory->createAdaptor(entity); | 50 | auto adaptor = eventFactory->createAdaptor(entity); |
47 | //FIXME set revision? | ||
48 | Akonadi2::ApplicationDomain::Event event(resourceIdentifier, state.key(), -1, adaptor); | 51 | Akonadi2::ApplicationDomain::Event event(resourceIdentifier, state.key(), -1, adaptor); |
49 | Akonadi2::ApplicationDomain::TypeImplementation<Akonadi2::ApplicationDomain::Event>::index(event, transaction); | 52 | Akonadi2::ApplicationDomain::TypeImplementation<Akonadi2::ApplicationDomain::Event>::index(event, transaction); |
50 | 53 | ||
@@ -58,15 +61,75 @@ DummyResource::DummyResource(const QByteArray &instanceIdentifier, const QShared | |||
58 | mPipeline->setPreprocessors(ENTITY_TYPE_EVENT, Akonadi2::Pipeline::NewPipeline, QVector<Akonadi2::Preprocessor*>() << eventIndexer); | 61 | mPipeline->setPreprocessors(ENTITY_TYPE_EVENT, Akonadi2::Pipeline::NewPipeline, QVector<Akonadi2::Preprocessor*>() << eventIndexer); |
59 | mPipeline->setAdaptorFactory(ENTITY_TYPE_EVENT, eventFactory); | 62 | mPipeline->setAdaptorFactory(ENTITY_TYPE_EVENT, eventFactory); |
60 | //TODO cleanup indexes during removal | 63 | //TODO cleanup indexes during removal |
64 | |||
65 | { | ||
66 | auto mailFactory = QSharedPointer<DummyMailAdaptorFactory>::create(); | ||
67 | auto mailIndexer = new Akonadi2::SimpleProcessor("mailIndexer", [mailFactory, resourceIdentifier](const Akonadi2::PipelineState &state, const Akonadi2::Entity &entity, Akonadi2::Storage::Transaction &transaction) { | ||
68 | auto adaptor = mailFactory->createAdaptor(entity); | ||
69 | Akonadi2::ApplicationDomain::Mail mail(resourceIdentifier, state.key(), -1, adaptor); | ||
70 | Akonadi2::ApplicationDomain::TypeImplementation<Akonadi2::ApplicationDomain::Mail>::index(mail, transaction); | ||
71 | |||
72 | Index ridIndex("mail.index.rid", transaction); | ||
73 | const auto rid = mail.getProperty("remoteId"); | ||
74 | if (rid.isValid()) { | ||
75 | ridIndex.add(rid.toByteArray(), mail.identifier()); | ||
76 | } | ||
77 | }); | ||
78 | |||
79 | mPipeline->setPreprocessors(ENTITY_TYPE_MAIL, Akonadi2::Pipeline::NewPipeline, QVector<Akonadi2::Preprocessor*>() << mailIndexer); | ||
80 | mPipeline->setAdaptorFactory(ENTITY_TYPE_MAIL, mailFactory); | ||
81 | } | ||
82 | } | ||
83 | |||
84 | void DummyResource::createEvent(const QByteArray &ridBuffer, const QByteArray &data, flatbuffers::FlatBufferBuilder &entityFbb) | ||
85 | { | ||
86 | auto eventBuffer = DummyCalendar::GetDummyEvent(data.data()); | ||
87 | |||
88 | //Map the source format to the buffer format (which happens to be an exact copy here) | ||
89 | auto summary = m_fbb.CreateString(eventBuffer->summary()->c_str()); | ||
90 | auto rid = m_fbb.CreateString(std::string(ridBuffer.constData(), ridBuffer.size())); | ||
91 | auto description = m_fbb.CreateString(std::string(ridBuffer.constData(), ridBuffer.size())); | ||
92 | static uint8_t rawData[100]; | ||
93 | auto attachment = Akonadi2::EntityBuffer::appendAsVector(m_fbb, rawData, 100); | ||
94 | |||
95 | auto builder = DummyCalendar::DummyEventBuilder(m_fbb); | ||
96 | builder.add_summary(summary); | ||
97 | builder.add_remoteId(rid); | ||
98 | builder.add_description(description); | ||
99 | builder.add_attachment(attachment); | ||
100 | auto buffer = builder.Finish(); | ||
101 | DummyCalendar::FinishDummyEventBuffer(m_fbb, buffer); | ||
102 | Akonadi2::EntityBuffer::assembleEntityBuffer(entityFbb, 0, 0, m_fbb.GetBufferPointer(), m_fbb.GetSize(), 0, 0); | ||
103 | } | ||
104 | |||
105 | void DummyResource::createMail(const QByteArray &ridBuffer, const QByteArray &data, flatbuffers::FlatBufferBuilder &entityFbb) | ||
106 | { | ||
107 | auto mailBuffer = Akonadi2::ApplicationDomain::Buffer::GetMail(data.data()); | ||
108 | |||
109 | //Map the source format to the buffer format (which happens to be an exact copy here) | ||
110 | auto subject = m_fbb.CreateString(mailBuffer->subject()->c_str()); | ||
111 | auto rid = m_fbb.CreateString(std::string(ridBuffer.constData(), ridBuffer.size())); | ||
112 | // auto description = m_fbb.CreateString(std::string(ridBuffer.constData(), ridBuffer.size())); | ||
113 | // static uint8_t rawData[100]; | ||
114 | // auto attachment = Akonadi2::EntityBuffer::appendAsVector(m_fbb, rawData, 100); | ||
115 | |||
116 | auto builder = Akonadi2::ApplicationDomain::Buffer::MailBuilder(m_fbb); | ||
117 | builder.add_subject(subject); | ||
118 | // builder.add(rid); | ||
119 | // builder.add_description(description); | ||
120 | // builder.add_attachment(attachment); | ||
121 | auto buffer = builder.Finish(); | ||
122 | Akonadi2::ApplicationDomain::Buffer::FinishMailBuffer(m_fbb, buffer); | ||
123 | Akonadi2::EntityBuffer::assembleEntityBuffer(entityFbb, 0, 0, 0, 0, m_fbb.GetBufferPointer(), m_fbb.GetSize()); | ||
61 | } | 124 | } |
62 | 125 | ||
63 | KAsync::Job<void> DummyResource::synchronizeWithSource() | 126 | KAsync::Job<void> DummyResource::synchronizeWithSource() |
64 | { | 127 | { |
65 | return KAsync::start<void>([this](KAsync::Future<void> &f) { | 128 | return KAsync::start<void>([this](KAsync::Future<void> &f) { |
66 | auto transaction = Akonadi2::Storage(Akonadi2::storageLocation(), mResourceInstanceIdentifier + ".index.uid", Akonadi2::Storage::ReadOnly).createTransaction(Akonadi2::Storage::ReadOnly); | 129 | auto transaction = Akonadi2::Storage(Akonadi2::storageLocation(), mResourceInstanceIdentifier, Akonadi2::Storage::ReadOnly).createTransaction(Akonadi2::Storage::ReadOnly); |
67 | Index uidIndex("index.uid", transaction); | 130 | Index uidIndex("index.uid", transaction); |
68 | 131 | ||
69 | const auto data = DummyStore::instance().data(); | 132 | const auto data = DummyStore::instance().events(); |
70 | for (auto it = data.constBegin(); it != data.constEnd(); it++) { | 133 | for (auto it = data.constBegin(); it != data.constEnd(); it++) { |
71 | bool isNew = true; | 134 | bool isNew = true; |
72 | uidIndex.lookup(it.key().toLatin1(), [&](const QByteArray &value) { | 135 | uidIndex.lookup(it.key().toLatin1(), [&](const QByteArray &value) { |
@@ -80,25 +143,8 @@ KAsync::Job<void> DummyResource::synchronizeWithSource() | |||
80 | if (isNew) { | 143 | if (isNew) { |
81 | m_fbb.Clear(); | 144 | m_fbb.Clear(); |
82 | 145 | ||
83 | const QByteArray data = it.value().toUtf8(); | ||
84 | auto eventBuffer = DummyCalendar::GetDummyEvent(data.data()); | ||
85 | |||
86 | //Map the source format to the buffer format (which happens to be an exact copy here) | ||
87 | auto summary = m_fbb.CreateString(eventBuffer->summary()->c_str()); | ||
88 | auto rid = m_fbb.CreateString(it.key().toStdString().c_str()); | ||
89 | auto description = m_fbb.CreateString(it.key().toStdString().c_str()); | ||
90 | static uint8_t rawData[100]; | ||
91 | auto attachment = Akonadi2::EntityBuffer::appendAsVector(m_fbb, rawData, 100); | ||
92 | |||
93 | auto builder = DummyCalendar::DummyEventBuilder(m_fbb); | ||
94 | builder.add_summary(summary); | ||
95 | builder.add_remoteId(rid); | ||
96 | builder.add_description(description); | ||
97 | builder.add_attachment(attachment); | ||
98 | auto buffer = builder.Finish(); | ||
99 | DummyCalendar::FinishDummyEventBuffer(m_fbb, buffer); | ||
100 | flatbuffers::FlatBufferBuilder entityFbb; | 146 | flatbuffers::FlatBufferBuilder entityFbb; |
101 | Akonadi2::EntityBuffer::assembleEntityBuffer(entityFbb, 0, 0, m_fbb.GetBufferPointer(), m_fbb.GetSize(), 0, 0); | 147 | createEvent(it.key().toUtf8(), it.value().toUtf8(), entityFbb); |
102 | 148 | ||
103 | flatbuffers::FlatBufferBuilder fbb; | 149 | flatbuffers::FlatBufferBuilder fbb; |
104 | //This is the resource type and not the domain type | 150 | //This is the resource type and not the domain type |
@@ -113,6 +159,43 @@ KAsync::Job<void> DummyResource::synchronizeWithSource() | |||
113 | } | 159 | } |
114 | } | 160 | } |
115 | //TODO find items to remove | 161 | //TODO find items to remove |
162 | |||
163 | const auto mails = DummyStore::instance().mails(); | ||
164 | for (auto it = mails.constBegin(); it != mails.constEnd(); it++) { | ||
165 | bool isNew = true; | ||
166 | uidIndex.lookup(it.key().toLatin1(), [&](const QByteArray &value) { | ||
167 | isNew = false; | ||
168 | }, | ||
169 | [](const Index::Error &error) { | ||
170 | if (error.code != Index::IndexNotAvailable) { | ||
171 | Warning() << "Error in uid index: " << error.message; | ||
172 | } | ||
173 | }); | ||
174 | if (isNew) { | ||
175 | m_fbb.Clear(); | ||
176 | |||
177 | flatbuffers::FlatBufferBuilder entityFbb; | ||
178 | createMail(it.key().toUtf8(), it.value().toUtf8(), entityFbb); | ||
179 | |||
180 | flatbuffers::Verifier verifyer(reinterpret_cast<const uint8_t *>(entityFbb.GetBufferPointer()), entityFbb.GetSize()); | ||
181 | if (!Akonadi2::ApplicationDomain::Buffer::VerifyMailBuffer(verifyer)) { | ||
182 | Warning() << "invalid buffer, not a mail buffer"; | ||
183 | } | ||
184 | |||
185 | flatbuffers::FlatBufferBuilder fbb; | ||
186 | //This is the resource type and not the domain type | ||
187 | auto type = fbb.CreateString(ENTITY_TYPE_MAIL); | ||
188 | auto delta = Akonadi2::EntityBuffer::appendAsVector(fbb, entityFbb.GetBufferPointer(), entityFbb.GetSize()); | ||
189 | auto location = Akonadi2::Commands::CreateCreateEntity(fbb, type, delta); | ||
190 | Akonadi2::Commands::FinishCreateEntityBuffer(fbb, location); | ||
191 | |||
192 | enqueueCommand(mSynchronizerQueue, Akonadi2::Commands::CreateEntityCommand, QByteArray::fromRawData(reinterpret_cast<char const *>(fbb.GetBufferPointer()), fbb.GetSize())); | ||
193 | } else { //modification | ||
194 | //TODO diff and create modification if necessary | ||
195 | } | ||
196 | } | ||
197 | //TODO find items to remove | ||
198 | |||
116 | f.setFinished(); | 199 | f.setFinished(); |
117 | }); | 200 | }); |
118 | } | 201 | } |
@@ -132,6 +215,7 @@ Akonadi2::Resource *DummyResourceFactory::createResource(const QByteArray &insta | |||
132 | void DummyResourceFactory::registerFacades(Akonadi2::FacadeFactory &factory) | 215 | void DummyResourceFactory::registerFacades(Akonadi2::FacadeFactory &factory) |
133 | { | 216 | { |
134 | factory.registerFacade<Akonadi2::ApplicationDomain::Event, DummyResourceFacade>(PLUGIN_NAME); | 217 | factory.registerFacade<Akonadi2::ApplicationDomain::Event, DummyResourceFacade>(PLUGIN_NAME); |
218 | factory.registerFacade<Akonadi2::ApplicationDomain::Mail, DummyResourceMailFacade>(PLUGIN_NAME); | ||
135 | } | 219 | } |
136 | 220 | ||
137 | #include "resourcefactory.moc" | 221 | #include "resourcefactory.moc" |
diff --git a/examples/dummyresource/resourcefactory.h b/examples/dummyresource/resourcefactory.h index 4baafa7..cf0f624 100644 --- a/examples/dummyresource/resourcefactory.h +++ b/examples/dummyresource/resourcefactory.h | |||
@@ -34,6 +34,9 @@ class DummyResource : public Akonadi2::GenericResource | |||
34 | public: | 34 | public: |
35 | DummyResource(const QByteArray &instanceIdentifier, const QSharedPointer<Akonadi2::Pipeline> &pipeline = QSharedPointer<Akonadi2::Pipeline>()); | 35 | DummyResource(const QByteArray &instanceIdentifier, const QSharedPointer<Akonadi2::Pipeline> &pipeline = QSharedPointer<Akonadi2::Pipeline>()); |
36 | KAsync::Job<void> synchronizeWithSource() Q_DECL_OVERRIDE; | 36 | KAsync::Job<void> synchronizeWithSource() Q_DECL_OVERRIDE; |
37 | private: | ||
38 | void createEvent(const QByteArray &rid, const QByteArray &data, flatbuffers::FlatBufferBuilder &entityFbb); | ||
39 | void createMail(const QByteArray &rid, const QByteArray &data, flatbuffers::FlatBufferBuilder &entityFbb); | ||
37 | }; | 40 | }; |
38 | 41 | ||
39 | class DummyResourceFactory : public Akonadi2::ResourceFactory | 42 | class DummyResourceFactory : public Akonadi2::ResourceFactory |