From 0f24357d01bd8a278f03793db863d3f71ac37ef2 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 18 Nov 2015 00:51:55 +0100 Subject: Don't use a smart pointer for the result provider We're not doing any lifetime management anyways. --- tests/clientapitest.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/clientapitest.cpp') diff --git a/tests/clientapitest.cpp b/tests/clientapitest.cpp index 2ce64d3..9202e29 100644 --- a/tests/clientapitest.cpp +++ b/tests/clientapitest.cpp @@ -27,14 +27,14 @@ public: KAsync::Job create(const T &domainObject) Q_DECL_OVERRIDE { return KAsync::null(); }; KAsync::Job modify(const T &domainObject) Q_DECL_OVERRIDE { return KAsync::null(); }; KAsync::Job remove(const T &domainObject) Q_DECL_OVERRIDE { return KAsync::null(); }; - KAsync::Job load(const Akonadi2::Query &query, const QSharedPointer > &resultProvider) Q_DECL_OVERRIDE + KAsync::Job load(const Akonadi2::Query &query, Akonadi2::ResultProviderInterface &resultProvider) Q_DECL_OVERRIDE { - capturedResultProvider = resultProvider; - resultProvider->setFetcher([query, resultProvider, this](const QByteArray &) { + capturedResultProvider = &resultProvider; + resultProvider.setFetcher([query, &resultProvider, this](const QByteArray &) { for (const auto &res : results) { qDebug() << "Parent filter " << query.propertyFilter.value("parent").toByteArray() << res->identifier(); if (!query.propertyFilter.contains("parent") || query.propertyFilter.value("parent").toByteArray() == res->getProperty("parent").toByteArray()) { - resultProvider->add(res); + resultProvider.add(res); } } }); @@ -42,7 +42,7 @@ public: } QList results; - QWeakPointer > capturedResultProvider; + Akonadi2::ResultProviderInterface *capturedResultProvider; }; @@ -94,7 +94,7 @@ private Q_SLOTS: QCOMPARE(result.size(), 1); } //It's running in a separate thread, so we have to wait for a moment until the query provider deletes itself. - QTRY_VERIFY(!facade->capturedResultProvider); + // QTRY_VERIFY(!facade->capturedResultProvider); } //TODO: This test doesn't belong to this testsuite -- cgit v1.2.3