diff options
Diffstat (limited to 'client/test/clientapitest.cpp')
-rw-r--r-- | client/test/clientapitest.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/client/test/clientapitest.cpp b/client/test/clientapitest.cpp index 8d8f552..bff910b 100644 --- a/client/test/clientapitest.cpp +++ b/client/test/clientapitest.cpp | |||
@@ -11,7 +11,7 @@ public: | |||
11 | virtual void create(const Akonadi2::Domain::Event &domainObject){}; | 11 | virtual void create(const Akonadi2::Domain::Event &domainObject){}; |
12 | virtual void modify(const Akonadi2::Domain::Event &domainObject){}; | 12 | virtual void modify(const Akonadi2::Domain::Event &domainObject){}; |
13 | virtual void remove(const Akonadi2::Domain::Event &domainObject){}; | 13 | virtual void remove(const Akonadi2::Domain::Event &domainObject){}; |
14 | virtual void load(const Akonadi2::Query &query, const std::function<void(const Akonadi2::Domain::Event &)> &resultCallback) | 14 | virtual void load(const Akonadi2::Query &query, const std::function<void(const Akonadi2::Domain::Event::Ptr &)> &resultCallback) |
15 | { | 15 | { |
16 | qDebug() << "load called"; | 16 | qDebug() << "load called"; |
17 | for(const auto &result : results) { | 17 | for(const auto &result : results) { |
@@ -19,7 +19,7 @@ public: | |||
19 | } | 19 | } |
20 | } | 20 | } |
21 | 21 | ||
22 | QList<Akonadi2::Domain::Event> results; | 22 | QList<Akonadi2::Domain::Event::Ptr> results; |
23 | }; | 23 | }; |
24 | 24 | ||
25 | class ClientAPITest : public QObject | 25 | class ClientAPITest : public QObject |
@@ -30,7 +30,7 @@ private Q_SLOTS: | |||
30 | void testLoad() | 30 | void testLoad() |
31 | { | 31 | { |
32 | DummyResourceFacade facade; | 32 | DummyResourceFacade facade; |
33 | facade.results << Akonadi2::Domain::Event(); | 33 | facade.results << QSharedPointer<Akonadi2::Domain::Event>::create("resource", "id", 0); |
34 | 34 | ||
35 | Akonadi2::FacadeFactory::instance().registerFacade<Akonadi2::Domain::Event, DummyResourceFacade>("dummyresource", [facade](){ return new DummyResourceFacade(facade); }); | 35 | Akonadi2::FacadeFactory::instance().registerFacade<Akonadi2::Domain::Event, DummyResourceFacade>("dummyresource", [facade](){ return new DummyResourceFacade(facade); }); |
36 | 36 | ||
@@ -39,8 +39,8 @@ private Q_SLOTS: | |||
39 | 39 | ||
40 | auto result = Akonadi2::Store::load<Akonadi2::Domain::Event>(query); | 40 | auto result = Akonadi2::Store::load<Akonadi2::Domain::Event>(query); |
41 | 41 | ||
42 | QList<Akonadi2::Domain::Event> resultSet; | 42 | QList<Akonadi2::Domain::Event::Ptr> resultSet; |
43 | result->onAdded([&resultSet](const Akonadi2::Domain::Event &event){ resultSet << event; qDebug() << "result added";}); | 43 | result->onAdded([&resultSet](const Akonadi2::Domain::Event::Ptr &event){ resultSet << event; qDebug() << "result added";}); |
44 | 44 | ||
45 | bool complete; | 45 | bool complete; |
46 | result->onComplete([&complete]{ complete = true; qDebug() << "complete";}); | 46 | result->onComplete([&complete]{ complete = true; qDebug() << "complete";}); |