diff options
Diffstat (limited to 'common/test')
-rw-r--r-- | common/test/clientapitest.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/common/test/clientapitest.cpp b/common/test/clientapitest.cpp index 16616a3..c9e4d6d 100644 --- a/common/test/clientapitest.cpp +++ b/common/test/clientapitest.cpp | |||
@@ -11,13 +11,15 @@ public: | |||
11 | virtual Async::Job<void> create(const Akonadi2::Domain::Event &domainObject){ return Async::null<void>(); }; | 11 | virtual Async::Job<void> create(const Akonadi2::Domain::Event &domainObject){ return Async::null<void>(); }; |
12 | virtual Async::Job<void> modify(const Akonadi2::Domain::Event &domainObject){ return Async::null<void>(); }; | 12 | virtual Async::Job<void> modify(const Akonadi2::Domain::Event &domainObject){ return Async::null<void>(); }; |
13 | virtual Async::Job<void> remove(const Akonadi2::Domain::Event &domainObject){ return Async::null<void>(); }; | 13 | virtual Async::Job<void> remove(const Akonadi2::Domain::Event &domainObject){ return Async::null<void>(); }; |
14 | virtual void load(const Akonadi2::Query &query, const std::function<void(const Akonadi2::Domain::Event::Ptr &)> &resultCallback, const std::function<void()> &completeCallback) | 14 | virtual Async::Job<void> load(const Akonadi2::Query &query, const std::function<void(const Akonadi2::Domain::Event::Ptr &)> &resultCallback) |
15 | { | 15 | { |
16 | qDebug() << "load called"; | 16 | return Async::start<void>([this, resultCallback](Async::Future<void> &future) { |
17 | for(const auto &result : results) { | 17 | qDebug() << "load called"; |
18 | resultCallback(result); | 18 | for(const auto &result : results) { |
19 | } | 19 | resultCallback(result); |
20 | completeCallback(); | 20 | } |
21 | future.setFinished(); | ||
22 | }); | ||
21 | } | 23 | } |
22 | 24 | ||
23 | QList<Akonadi2::Domain::Event::Ptr> results; | 25 | QList<Akonadi2::Domain::Event::Ptr> results; |