From c55054e899660f2d667af2c2e573a1267d47358e Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 13 Apr 2015 20:15:14 +0200 Subject: Use a queryrunner to execute queries. The queryrunner is responsible for running queries and keeping them up to date. This is required for self-updating queries. To get this to work properly the ResultProvider/emitter had to be fixed. The emitter now only lives as long as the client holds a reference to it, allowing the provider to detect when it is no longer necessary to keep the query alive (because noone is listening). In the process various lifetime issues have been fixed, that we're caused by lambdas capturing smartpointers, that then extended the lifetime of the associated objects unpredictably. --- dummyresource/facade.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'dummyresource/facade.h') diff --git a/dummyresource/facade.h b/dummyresource/facade.h index 37ed81d..3ddfe15 100644 --- a/dummyresource/facade.h +++ b/dummyresource/facade.h @@ -34,10 +34,11 @@ class DummyResourceFacade : public Akonadi2::GenericFacade create(const Akonadi2::ApplicationDomain::Event &domainObject); - virtual Async::Job modify(const Akonadi2::ApplicationDomain::Event &domainObject); - virtual Async::Job remove(const Akonadi2::ApplicationDomain::Event &domainObject); - virtual Async::Job load(const Akonadi2::Query &query, const std::function &resultCallback); + Async::Job create(const Akonadi2::ApplicationDomain::Event &domainObject) Q_DECL_OVERRIDE; + Async::Job modify(const Akonadi2::ApplicationDomain::Event &domainObject) Q_DECL_OVERRIDE; + Async::Job remove(const Akonadi2::ApplicationDomain::Event &domainObject) Q_DECL_OVERRIDE; + Async::Job load(const Akonadi2::Query &query, const std::function &resultCallback) Q_DECL_OVERRIDE; + Async::Job load(const Akonadi2::Query &query, const QSharedPointer > &resultProvider) Q_DECL_OVERRIDE; private: void readValue(QSharedPointer storage, const QByteArray &key, const std::function &resultCallback, std::function); -- cgit v1.2.3