summaryrefslogtreecommitdiffstats
path: root/common/test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/test.cpp')
-rw-r--r--common/test.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/common/test.cpp b/common/test.cpp
index 237d3bb..52d79ca 100644
--- a/common/test.cpp
+++ b/common/test.cpp
@@ -150,22 +150,13 @@ public:
150 // We have to do it this way, otherwise we're not setting the fetcher right 150 // We have to do it this way, otherwise we're not setting the fetcher right
151 auto emitter = resultProvider->emitter(); 151 auto emitter = resultProvider->emitter();
152 152
153 resultProvider->setFetcher([query, resultProvider, this](const typename T::Ptr &parent) { 153 resultProvider->setFetcher([query, resultProvider, this]() {
154 if (parent) { 154 SinkTrace() << "Running the fetcher.";
155 SinkTrace() << "Running the fetcher " << parent->identifier();
156 } else {
157 SinkTrace() << "Running the fetcher.";
158 }
159 SinkTrace() << "-------------------------."; 155 SinkTrace() << "-------------------------.";
160 for (const auto &res : mTestAccount->entities<T>()) { 156 for (const auto &res : mTestAccount->entities<T>()) {
161 qDebug() << "Parent filter " << query.getFilter("parent").value.toByteArray() << res->identifier() << res->getProperty("parent").toByteArray(); 157 resultProvider->add(res.template staticCast<T>());
162 auto parentProperty = res->getProperty("parent").toByteArray();
163 if ((!parent && parentProperty.isEmpty()) || (parent && parentProperty == parent->identifier()) || query.parentProperty().isEmpty()) {
164 qDebug() << "Found a match" << res->identifier();
165 resultProvider->add(res.template staticCast<T>());
166 }
167 } 158 }
168 resultProvider->initialResultSetComplete(parent, true); 159 resultProvider->initialResultSetComplete(true);
169 }); 160 });
170 auto job = KAsync::start([query, resultProvider]() {}); 161 auto job = KAsync::start([query, resultProvider]() {});
171 return qMakePair(job, emitter); 162 return qMakePair(job, emitter);