From d417f01e2eebeedfaae76b40667372bd0fb21fea Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 18 Jan 2015 14:29:08 +0100 Subject: Use jobs in queries, sync works again. --- common/test/clientapitest.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'common/test/clientapitest.cpp') 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: virtual Async::Job create(const Akonadi2::Domain::Event &domainObject){ return Async::null(); }; virtual Async::Job modify(const Akonadi2::Domain::Event &domainObject){ return Async::null(); }; virtual Async::Job remove(const Akonadi2::Domain::Event &domainObject){ return Async::null(); }; - virtual void load(const Akonadi2::Query &query, const std::function &resultCallback, const std::function &completeCallback) + virtual Async::Job load(const Akonadi2::Query &query, const std::function &resultCallback) { - qDebug() << "load called"; - for(const auto &result : results) { - resultCallback(result); - } - completeCallback(); + return Async::start([this, resultCallback](Async::Future &future) { + qDebug() << "load called"; + for(const auto &result : results) { + resultCallback(result); + } + future.setFinished(); + }); } QList results; -- cgit v1.2.3