diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-01-14 18:52:04 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-01-14 18:52:04 +0100 |
commit | 78284e0963d93e3e0f85e2165013412580a3b8c1 (patch) | |
tree | b4f0b5750c3f27ad107cc66358bd7b930b8399bc /tests/querytest.cpp | |
parent | 7de95983b30ca414c04bb3f877b67c1b7e9d6fa0 (diff) | |
download | sink-78284e0963d93e3e0f85e2165013412580a3b8c1.tar.gz sink-78284e0963d93e3e0f85e2165013412580a3b8c1.zip |
Got rid of all uses of Query::syncOnDemand and Query::processAll
Diffstat (limited to 'tests/querytest.cpp')
-rw-r--r-- | tests/querytest.cpp | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/tests/querytest.cpp b/tests/querytest.cpp index e09f7a4..f9344cd 100644 --- a/tests/querytest.cpp +++ b/tests/querytest.cpp | |||
@@ -48,8 +48,6 @@ private Q_SLOTS: | |||
48 | //Test | 48 | //Test |
49 | Akonadi2::Query query; | 49 | Akonadi2::Query query; |
50 | query.resources << "foobar"; | 50 | query.resources << "foobar"; |
51 | query.syncOnDemand = false; | ||
52 | query.processAll = false; | ||
53 | query.liveQuery = true; | 51 | query.liveQuery = true; |
54 | 52 | ||
55 | //We fetch before the data is available and rely on the live query mechanism to deliver the actual data | 53 | //We fetch before the data is available and rely on the live query mechanism to deliver the actual data |
@@ -70,8 +68,6 @@ private Q_SLOTS: | |||
70 | //Test | 68 | //Test |
71 | Akonadi2::Query query; | 69 | Akonadi2::Query query; |
72 | query.resources << "org.kde.dummy.instance1"; | 70 | query.resources << "org.kde.dummy.instance1"; |
73 | query.syncOnDemand = false; | ||
74 | query.processAll = false; | ||
75 | query.liveQuery = true; | 71 | query.liveQuery = true; |
76 | 72 | ||
77 | //We fetch before the data is available and rely on the live query mechanism to deliver the actual data | 73 | //We fetch before the data is available and rely on the live query mechanism to deliver the actual data |
@@ -91,12 +87,10 @@ private Q_SLOTS: | |||
91 | //Test | 87 | //Test |
92 | Akonadi2::Query query; | 88 | Akonadi2::Query query; |
93 | query.resources << "org.kde.dummy.instance1"; | 89 | query.resources << "org.kde.dummy.instance1"; |
94 | query.syncOnDemand = false; | ||
95 | query.processAll = true; | ||
96 | query.liveQuery = false; | 90 | query.liveQuery = false; |
97 | 91 | ||
98 | //Ensure all local data is processed | 92 | //Ensure all local data is processed |
99 | Akonadi2::Store::synchronize(query).exec().waitForFinished(); | 93 | Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); |
100 | 94 | ||
101 | //We fetch after the data is available and don't rely on the live query mechanism to deliver the actual data | 95 | //We fetch after the data is available and don't rely on the live query mechanism to deliver the actual data |
102 | auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Mail>(query); | 96 | auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Mail>(query); |
@@ -150,8 +144,6 @@ private Q_SLOTS: | |||
150 | //Test | 144 | //Test |
151 | Akonadi2::Query query; | 145 | Akonadi2::Query query; |
152 | query.resources << "org.kde.dummy.instance1"; | 146 | query.resources << "org.kde.dummy.instance1"; |
153 | query.syncOnDemand = false; | ||
154 | query.processAll = false; | ||
155 | query.liveQuery = true; | 147 | query.liveQuery = true; |
156 | 148 | ||
157 | //We fetch before the data is available and rely on the live query mechanism to deliver the actual data | 149 | //We fetch before the data is available and rely on the live query mechanism to deliver the actual data |
@@ -171,11 +163,9 @@ private Q_SLOTS: | |||
171 | 163 | ||
172 | Akonadi2::Query query; | 164 | Akonadi2::Query query; |
173 | query.resources << "org.kde.dummy.instance1"; | 165 | query.resources << "org.kde.dummy.instance1"; |
174 | query.syncOnDemand = false; | ||
175 | query.processAll = true; | ||
176 | 166 | ||
177 | //Ensure all local data is processed | 167 | //Ensure all local data is processed |
178 | Akonadi2::Store::synchronize(query).exec().waitForFinished(); | 168 | Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); |
179 | 169 | ||
180 | auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Folder>(query); | 170 | auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Folder>(query); |
181 | QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); | 171 | QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); |
@@ -192,12 +182,10 @@ private Q_SLOTS: | |||
192 | //Test | 182 | //Test |
193 | Akonadi2::Query query; | 183 | Akonadi2::Query query; |
194 | query.resources << "org.kde.dummy.instance1"; | 184 | query.resources << "org.kde.dummy.instance1"; |
195 | query.syncOnDemand = false; | ||
196 | query.processAll = true; | ||
197 | query.parentProperty = "parent"; | 185 | query.parentProperty = "parent"; |
198 | 186 | ||
199 | //Ensure all local data is processed | 187 | //Ensure all local data is processed |
200 | Akonadi2::Store::synchronize(query).exec().waitForFinished(); | 188 | Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); |
201 | 189 | ||
202 | //We fetch after the data is available and don't rely on the live query mechanism to deliver the actual data | 190 | //We fetch after the data is available and don't rely on the live query mechanism to deliver the actual data |
203 | auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Folder>(query); | 191 | auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Folder>(query); |
@@ -222,13 +210,11 @@ private Q_SLOTS: | |||
222 | //Test | 210 | //Test |
223 | Akonadi2::Query query; | 211 | Akonadi2::Query query; |
224 | query.resources << "org.kde.dummy.instance1"; | 212 | query.resources << "org.kde.dummy.instance1"; |
225 | query.syncOnDemand = false; | ||
226 | query.processAll = true; | ||
227 | query.liveQuery = false; | 213 | query.liveQuery = false; |
228 | query.propertyFilter.insert("uid", "test1"); | 214 | query.propertyFilter.insert("uid", "test1"); |
229 | 215 | ||
230 | //Ensure all local data is processed | 216 | //Ensure all local data is processed |
231 | Akonadi2::Store::synchronize(query).exec().waitForFinished(); | 217 | Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); |
232 | 218 | ||
233 | //We fetch before the data is available and rely on the live query mechanism to deliver the actual data | 219 | //We fetch before the data is available and rely on the live query mechanism to deliver the actual data |
234 | auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Mail>(query); | 220 | auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Mail>(query); |
@@ -246,11 +232,9 @@ private Q_SLOTS: | |||
246 | 232 | ||
247 | Akonadi2::Query query; | 233 | Akonadi2::Query query; |
248 | query.resources << "org.kde.dummy.instance1"; | 234 | query.resources << "org.kde.dummy.instance1"; |
249 | query.syncOnDemand = false; | ||
250 | query.processAll = true; | ||
251 | 235 | ||
252 | //Ensure all local data is processed | 236 | //Ensure all local data is processed |
253 | Akonadi2::Store::synchronize(query).exec().waitForFinished(); | 237 | Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); |
254 | 238 | ||
255 | auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Folder>(query); | 239 | auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Folder>(query); |
256 | QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); | 240 | QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); |
@@ -268,13 +252,10 @@ private Q_SLOTS: | |||
268 | //Test | 252 | //Test |
269 | Akonadi2::Query query; | 253 | Akonadi2::Query query; |
270 | query.resources << "org.kde.dummy.instance1"; | 254 | query.resources << "org.kde.dummy.instance1"; |
271 | query.syncOnDemand = false; | ||
272 | query.processAll = true; | ||
273 | query.liveQuery = false; | ||
274 | query.propertyFilter.insert("folder", folderEntity->identifier()); | 255 | query.propertyFilter.insert("folder", folderEntity->identifier()); |
275 | 256 | ||
276 | //Ensure all local data is processed | 257 | //Ensure all local data is processed |
277 | Akonadi2::Store::synchronize(query).exec().waitForFinished(); | 258 | Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); |
278 | 259 | ||
279 | //We fetch before the data is available and rely on the live query mechanism to deliver the actual data | 260 | //We fetch before the data is available and rely on the live query mechanism to deliver the actual data |
280 | auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Mail>(query); | 261 | auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Mail>(query); |