diff options
Diffstat (limited to 'tests/clientapitest.cpp')
-rw-r--r-- | tests/clientapitest.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/clientapitest.cpp b/tests/clientapitest.cpp index 2b3cc46..2ce64d3 100644 --- a/tests/clientapitest.cpp +++ b/tests/clientapitest.cpp | |||
@@ -30,14 +30,15 @@ public: | |||
30 | KAsync::Job<void> load(const Akonadi2::Query &query, const QSharedPointer<Akonadi2::ResultProviderInterface<typename T::Ptr> > &resultProvider) Q_DECL_OVERRIDE | 30 | KAsync::Job<void> load(const Akonadi2::Query &query, const QSharedPointer<Akonadi2::ResultProviderInterface<typename T::Ptr> > &resultProvider) Q_DECL_OVERRIDE |
31 | { | 31 | { |
32 | capturedResultProvider = resultProvider; | 32 | capturedResultProvider = resultProvider; |
33 | return KAsync::start<void>([this, resultProvider, query]() { | 33 | resultProvider->setFetcher([query, resultProvider, this](const QByteArray &) { |
34 | for (const auto &res : results) { | 34 | for (const auto &res : results) { |
35 | qDebug() << "Parent filter " << query.propertyFilter.value("parent").toByteArray() << res->identifier(); | 35 | qDebug() << "Parent filter " << query.propertyFilter.value("parent").toByteArray() << res->identifier(); |
36 | if (!query.propertyFilter.contains("parent") || query.propertyFilter.value("parent").toByteArray() == res->getProperty("parent").toByteArray()) { | 36 | if (!query.propertyFilter.contains("parent") || query.propertyFilter.value("parent").toByteArray() == res->getProperty("parent").toByteArray()) { |
37 | resultProvider->add(res); | 37 | resultProvider->add(res); |
38 | } | 38 | } |
39 | } | 39 | } |
40 | }); | 40 | }); |
41 | return KAsync::null<void>(); | ||
41 | } | 42 | } |
42 | 43 | ||
43 | QList<typename T::Ptr> results; | 44 | QList<typename T::Ptr> results; |
@@ -135,7 +136,7 @@ private Q_SLOTS: | |||
135 | query.resources << "dummyresource.instance1"; | 136 | query.resources << "dummyresource.instance1"; |
136 | query.liveQuery = false; | 137 | query.liveQuery = false; |
137 | 138 | ||
138 | auto model = new ModelResult<Akonadi2::ApplicationDomain::Folder>(query, QList<QByteArray>() << "summary" << "uid"); | 139 | auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Folder>(query); |
139 | model->fetchMore(QModelIndex()); | 140 | model->fetchMore(QModelIndex()); |
140 | QTRY_COMPARE(model->rowCount(), 1); | 141 | QTRY_COMPARE(model->rowCount(), 1); |
141 | } | 142 | } |
@@ -154,7 +155,7 @@ private Q_SLOTS: | |||
154 | query.resources << "dummyresource.instance1"; | 155 | query.resources << "dummyresource.instance1"; |
155 | query.liveQuery = false; | 156 | query.liveQuery = false; |
156 | 157 | ||
157 | auto model = new ModelResult<Akonadi2::ApplicationDomain::Folder>(query, QList<QByteArray>() << "summary" << "uid"); | 158 | auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Folder>(query); |
158 | model->fetchMore(QModelIndex()); | 159 | model->fetchMore(QModelIndex()); |
159 | QTRY_COMPARE(model->rowCount(), 1); | 160 | QTRY_COMPARE(model->rowCount(), 1); |
160 | model->fetchMore(model->index(0, 0)); | 161 | model->fetchMore(model->index(0, 0)); |