summaryrefslogtreecommitdiffstats
path: root/dummyresource/facade.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dummyresource/facade.cpp')
-rw-r--r--dummyresource/facade.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/dummyresource/facade.cpp b/dummyresource/facade.cpp
index 44056f8..668749e 100644
--- a/dummyresource/facade.cpp
+++ b/dummyresource/facade.cpp
@@ -44,7 +44,8 @@ void DummyResourceFacade::remove(const Akonadi2::Domain::Event &domainObject)
44//-how do we free/munmap the data if we don't know when no one references it any longer? => no munmap needed, but read transaction to keep pointer alive 44//-how do we free/munmap the data if we don't know when no one references it any longer? => no munmap needed, but read transaction to keep pointer alive
45//-we could bind the lifetime to the query 45//-we could bind the lifetime to the query
46//=> perhaps do heap allocate and use smart pointer? 46//=> perhaps do heap allocate and use smart pointer?
47class DummyEventAdaptor : public Akonadi2::Domain::Event { 47class DummyEventAdaptor : public Akonadi2::Domain::Event
48{
48public: 49public:
49 DummyEventAdaptor(const QString &resource, const QString &identifier, qint64 revision) 50 DummyEventAdaptor(const QString &resource, const QString &identifier, qint64 revision)
50 :Akonadi2::Domain::Event(resource, identifier, revision) 51 :Akonadi2::Domain::Event(resource, identifier, revision)
@@ -71,13 +72,13 @@ public:
71 DummyEvent const *buffer; 72 DummyEvent const *buffer;
72 73
73 //Keep query alive so values remain valid 74 //Keep query alive so values remain valid
74 QSharedPointer<Storage> storage; 75 QSharedPointer<Akonadi2::Storage> storage;
75}; 76};
76 77
77void DummyResourceFacade::load(const Akonadi2::Query &query, const std::function<void(const Akonadi2::Domain::Event::Ptr &)> &resultCallback) 78void DummyResourceFacade::load(const Akonadi2::Query &query, const std::function<void(const Akonadi2::Domain::Event::Ptr &)> &resultCallback)
78{ 79{
79 qDebug() << "load called"; 80 qDebug() << "load called";
80 auto storage = QSharedPointer<Storage>::create(Akonadi2::Store::storageLocation(), "dummyresource"); 81 auto storage = QSharedPointer<Akonadi2::Storage>::create(Akonadi2::Store::storageLocation(), "dummyresource");
81 82
82 //Compose some functions to make query matching fast. 83 //Compose some functions to make query matching fast.
83 //This way we can process the query once, and convert all values into something that can be compared quickly 84 //This way we can process the query once, and convert all values into something that can be compared quickly