diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-10-21 14:21:16 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-10-21 14:21:16 +0200 |
commit | 12cc3f612c3ebe9522f98c808f9d7115d8e222ce (patch) | |
tree | 8dd53dd441d8577b9d72289748a72cf76acd4cca /common/facade.h | |
parent | 264fb692ccd122e53c7592a26447ed8281179c8b (diff) | |
download | sink-12cc3f612c3ebe9522f98c808f9d7115d8e222ce.tar.gz sink-12cc3f612c3ebe9522f98c808f9d7115d8e222ce.zip |
Cleanup
Diffstat (limited to 'common/facade.h')
-rw-r--r-- | common/facade.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/common/facade.h b/common/facade.h index 0ddc205..13734f0 100644 --- a/common/facade.h +++ b/common/facade.h | |||
@@ -271,7 +271,7 @@ public: | |||
271 | } | 271 | } |
272 | 272 | ||
273 | //We have to capture the runner to keep it alive | 273 | //We have to capture the runner to keep it alive |
274 | return synchronizeResource(query.syncOnDemand, query.processAll).template then<void>([runner](KAsync::Future<void> &future) { | 274 | return synchronizeResource(query).template then<void>([runner](KAsync::Future<void> &future) { |
275 | runner->run().then<void>([&future]() { | 275 | runner->run().then<void>([&future]() { |
276 | future.setFinished(); | 276 | future.setFinished(); |
277 | }).exec(); | 277 | }).exec(); |
@@ -281,19 +281,18 @@ public: | |||
281 | }); | 281 | }); |
282 | } | 282 | } |
283 | 283 | ||
284 | protected: | 284 | private: |
285 | KAsync::Job<void> synchronizeResource(bool sync, bool processAll) | 285 | KAsync::Job<void> synchronizeResource(const Akonadi2::Query &query) |
286 | { | 286 | { |
287 | //TODO check if a sync is necessary | 287 | //TODO check if a sync is necessary |
288 | //TODO Only sync what was requested | 288 | //TODO Only sync what was requested |
289 | //TODO timeout | 289 | //TODO timeout |
290 | if (sync || processAll) { | 290 | if (query.syncOnDemand || query.processAll) { |
291 | return mResourceAccess->synchronizeResource(sync, processAll); | 291 | return mResourceAccess->synchronizeResource(query.syncOnDemand, query.processAll); |
292 | } | 292 | } |
293 | return KAsync::null<void>(); | 293 | return KAsync::null<void>(); |
294 | } | 294 | } |
295 | 295 | ||
296 | private: | ||
297 | virtual KAsync::Job<qint64> load(const Akonadi2::Query &query, const QSharedPointer<Akonadi2::ResultProvider<typename DomainType::Ptr> > &resultProvider, qint64 oldRevision) | 296 | virtual KAsync::Job<qint64> load(const Akonadi2::Query &query, const QSharedPointer<Akonadi2::ResultProvider<typename DomainType::Ptr> > &resultProvider, qint64 oldRevision) |
298 | { | 297 | { |
299 | return KAsync::start<qint64>([=]() -> qint64 { | 298 | return KAsync::start<qint64>([=]() -> qint64 { |