diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-11-18 00:51:55 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-11-18 00:51:55 +0100 |
commit | 0f24357d01bd8a278f03793db863d3f71ac37ef2 (patch) | |
tree | 331c908d936d70447d7e0e4d5e65be2be74ef510 /tests/clientapitest.cpp | |
parent | b68a67fdbe0eb73aaef648ceb686824c7fbc1552 (diff) | |
download | sink-0f24357d01bd8a278f03793db863d3f71ac37ef2.tar.gz sink-0f24357d01bd8a278f03793db863d3f71ac37ef2.zip |
Don't use a smart pointer for the result provider
We're not doing any lifetime management anyways.
Diffstat (limited to 'tests/clientapitest.cpp')
-rw-r--r-- | tests/clientapitest.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
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: | |||
27 | KAsync::Job<void> create(const T &domainObject) Q_DECL_OVERRIDE { return KAsync::null<void>(); }; | 27 | KAsync::Job<void> create(const T &domainObject) Q_DECL_OVERRIDE { return KAsync::null<void>(); }; |
28 | KAsync::Job<void> modify(const T &domainObject) Q_DECL_OVERRIDE { return KAsync::null<void>(); }; | 28 | KAsync::Job<void> modify(const T &domainObject) Q_DECL_OVERRIDE { return KAsync::null<void>(); }; |
29 | KAsync::Job<void> remove(const T &domainObject) Q_DECL_OVERRIDE { return KAsync::null<void>(); }; | 29 | KAsync::Job<void> remove(const T &domainObject) Q_DECL_OVERRIDE { return KAsync::null<void>(); }; |
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, Akonadi2::ResultProviderInterface<typename T::Ptr> &resultProvider) Q_DECL_OVERRIDE |
31 | { | 31 | { |
32 | capturedResultProvider = resultProvider; | 32 | capturedResultProvider = &resultProvider; |
33 | resultProvider->setFetcher([query, resultProvider, this](const QByteArray &) { | 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 | }); |
@@ -42,7 +42,7 @@ public: | |||
42 | } | 42 | } |
43 | 43 | ||
44 | QList<typename T::Ptr> results; | 44 | QList<typename T::Ptr> results; |
45 | QWeakPointer<Akonadi2::ResultProviderInterface<typename T::Ptr> > capturedResultProvider; | 45 | Akonadi2::ResultProviderInterface<typename T::Ptr> *capturedResultProvider; |
46 | }; | 46 | }; |
47 | 47 | ||
48 | 48 | ||
@@ -94,7 +94,7 @@ private Q_SLOTS: | |||
94 | QCOMPARE(result.size(), 1); | 94 | QCOMPARE(result.size(), 1); |
95 | } | 95 | } |
96 | //It's running in a separate thread, so we have to wait for a moment until the query provider deletes itself. | 96 | //It's running in a separate thread, so we have to wait for a moment until the query provider deletes itself. |
97 | QTRY_VERIFY(!facade->capturedResultProvider); | 97 | // QTRY_VERIFY(!facade->capturedResultProvider); |
98 | } | 98 | } |
99 | 99 | ||
100 | //TODO: This test doesn't belong to this testsuite | 100 | //TODO: This test doesn't belong to this testsuite |