summaryrefslogtreecommitdiffstats
path: root/client/test/clientapitest.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2014-12-12 11:48:09 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2014-12-12 11:48:09 +0100
commitb30fe2fa42a717d6e89710cde82ecf7f419b2fe9 (patch)
tree01b0a7b48b09dc908985e9473d9588d91e5294cf /client/test/clientapitest.cpp
parentc30e9145049c52feb2de719307ebbfee0650f01b (diff)
downloadsink-b30fe2fa42a717d6e89710cde82ecf7f419b2fe9.tar.gz
sink-b30fe2fa42a717d6e89710cde82ecf7f419b2fe9.zip
ClientAPI: Demonstrate how we can build powerful and flexible API's on top of ResultEmitter
Diffstat (limited to 'client/test/clientapitest.cpp')
-rw-r--r--client/test/clientapitest.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/client/test/clientapitest.cpp b/client/test/clientapitest.cpp
index bff910b..2d1c238 100644
--- a/client/test/clientapitest.cpp
+++ b/client/test/clientapitest.cpp
@@ -37,15 +37,9 @@ private Q_SLOTS:
37 Akonadi2::Query query; 37 Akonadi2::Query query;
38 query.resources << "dummyresource"; 38 query.resources << "dummyresource";
39 39
40 auto result = Akonadi2::Store::load<Akonadi2::Domain::Event>(query); 40 async::SyncListResult<Akonadi2::Domain::Event::Ptr> result(Akonadi2::Store::load<Akonadi2::Domain::Event>(query));
41 41 result.exec();
42 QList<Akonadi2::Domain::Event::Ptr> resultSet; 42 QCOMPARE(result.size(), 1);
43 result->onAdded([&resultSet](const Akonadi2::Domain::Event::Ptr &event){ resultSet << event; qDebug() << "result added";});
44
45 bool complete;
46 result->onComplete([&complete]{ complete = true; qDebug() << "complete";});
47
48 QTRY_VERIFY(complete);
49 } 43 }
50 44
51}; 45};