summaryrefslogtreecommitdiffstats
path: root/dummyresource/facade.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dummyresource/facade.cpp')
-rw-r--r--dummyresource/facade.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/dummyresource/facade.cpp b/dummyresource/facade.cpp
index 668fbbf..13c174b 100644
--- a/dummyresource/facade.cpp
+++ b/dummyresource/facade.cpp
@@ -46,7 +46,7 @@ DummyResourceFacade::~DummyResourceFacade()
46{ 46{
47} 47}
48 48
49void DummyResourceFacade::create(const Akonadi2::Domain::Event &domainObject) 49Async::Job<void> DummyResourceFacade::create(const Akonadi2::Domain::Event &domainObject)
50{ 50{
51 //Create message buffer and send to resource 51 //Create message buffer and send to resource
52 flatbuffers::FlatBufferBuilder eventFbb; 52 flatbuffers::FlatBufferBuilder eventFbb;
@@ -64,24 +64,28 @@ void DummyResourceFacade::create(const Akonadi2::Domain::Event &domainObject)
64 Akonadi2::EntityBuffer::assembleEntityBuffer(entityFbb, 0, 0, eventFbb.GetBufferPointer(), eventFbb.GetSize(), 0, 0); 64 Akonadi2::EntityBuffer::assembleEntityBuffer(entityFbb, 0, 0, eventFbb.GetBufferPointer(), eventFbb.GetSize(), 0, 0);
65 65
66 flatbuffers::FlatBufferBuilder fbb; 66 flatbuffers::FlatBufferBuilder fbb;
67 auto type = fbb.CreateString(Akonadi2::Domain::getTypeName<Akonadi2::Domain::Event>().toStdString().data()); 67 //This is the resource type and not the domain type
68 auto type = fbb.CreateString("event");
68 auto delta = fbb.CreateVector<uint8_t>(entityFbb.GetBufferPointer(), entityFbb.GetSize()); 69 auto delta = fbb.CreateVector<uint8_t>(entityFbb.GetBufferPointer(), entityFbb.GetSize());
69 Akonadi2::Commands::CreateEntityBuilder builder(fbb); 70 Akonadi2::Commands::CreateEntityBuilder builder(fbb);
70 builder.add_domainType(type); 71 builder.add_domainType(type);
71 builder.add_delta(delta); 72 builder.add_delta(delta);
72 auto location = builder.Finish(); 73 auto location = builder.Finish();
73 Akonadi2::Commands::FinishCreateEntityBuffer(fbb, location); 74 Akonadi2::Commands::FinishCreateEntityBuffer(fbb, location);
74 mResourceAccess->sendCommand(Akonadi2::Commands::CreateEntityCommand, fbb); 75 mResourceAccess->open();
76 return mResourceAccess->sendCommand(Akonadi2::Commands::CreateEntityCommand, fbb);
75} 77}
76 78
77void DummyResourceFacade::modify(const Akonadi2::Domain::Event &domainObject) 79Async::Job<void> DummyResourceFacade::modify(const Akonadi2::Domain::Event &domainObject)
78{ 80{
79 //Create message buffer and send to resource 81 //Create message buffer and send to resource
82 return Async::null<void>();
80} 83}
81 84
82void DummyResourceFacade::remove(const Akonadi2::Domain::Event &domainObject) 85Async::Job<void> DummyResourceFacade::remove(const Akonadi2::Domain::Event &domainObject)
83{ 86{
84 //Create message buffer and send to resource 87 //Create message buffer and send to resource
88 return Async::null<void>();
85} 89}
86 90
87static std::function<bool(const std::string &key, DummyEvent const *buffer)> prepareQuery(const Akonadi2::Query &query) 91static std::function<bool(const std::string &key, DummyEvent const *buffer)> prepareQuery(const Akonadi2::Query &query)