summaryrefslogtreecommitdiffstats
path: root/common/queryrunner.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2015-12-20 16:30:53 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2015-12-20 16:30:53 +0100
commitee14ef2f7ca4880a9e1f04fe4109640a38085082 (patch)
treee33a546f28c76df7ac1ea3778819eddc1164802a /common/queryrunner.cpp
parentd844c23b6fca4adf5978b3f9650bc55c796dd2e3 (diff)
downloadsink-ee14ef2f7ca4880a9e1f04fe4109640a38085082.tar.gz
sink-ee14ef2f7ca4880a9e1f04fe4109640a38085082.zip
The generator should produce values one by one.
k ...not all at once.
Diffstat (limited to 'common/queryrunner.cpp')
-rw-r--r--common/queryrunner.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/common/queryrunner.cpp b/common/queryrunner.cpp
index 718586f..2de3c10 100644
--- a/common/queryrunner.cpp
+++ b/common/queryrunner.cpp
@@ -201,7 +201,7 @@ ResultSet QueryRunner<DomainType>::filterSet(const ResultSet &resultSet, const s
201 201
202 //Read through the source values and return whatever matches the filter 202 //Read through the source values and return whatever matches the filter
203 std::function<bool(std::function<void(const Akonadi2::ApplicationDomain::ApplicationDomainType::Ptr &, Akonadi2::Operation)>)> generator = [this, resultSetPtr, &db, filter, initialQuery](std::function<void(const Akonadi2::ApplicationDomain::ApplicationDomainType::Ptr &, Akonadi2::Operation)> callback) -> bool { 203 std::function<bool(std::function<void(const Akonadi2::ApplicationDomain::ApplicationDomainType::Ptr &, Akonadi2::Operation)>)> generator = [this, resultSetPtr, &db, filter, initialQuery](std::function<void(const Akonadi2::ApplicationDomain::ApplicationDomainType::Ptr &, Akonadi2::Operation)> callback) -> bool {
204 while (resultSetPtr->next()) { 204 if (resultSetPtr->next()) {
205 //readEntity is only necessary if we actually want to filter or know the operation type (but not a big deal if we do it always I guess) 205 //readEntity is only necessary if we actually want to filter or know the operation type (but not a big deal if we do it always I guess)
206 readEntity(db, resultSetPtr->id(), [this, filter, callback, initialQuery](const Akonadi2::ApplicationDomain::ApplicationDomainType::Ptr &domainObject, Akonadi2::Operation operation) { 206 readEntity(db, resultSetPtr->id(), [this, filter, callback, initialQuery](const Akonadi2::ApplicationDomain::ApplicationDomainType::Ptr &domainObject, Akonadi2::Operation operation) {
207 //Always remove removals, they probably don't match due to non-available properties 207 //Always remove removals, they probably don't match due to non-available properties
@@ -216,8 +216,10 @@ ResultSet QueryRunner<DomainType>::filterSet(const ResultSet &resultSet, const s
216 } 216 }
217 } 217 }
218 }); 218 });
219 return true;
220 } else {
221 return false;
219 } 222 }
220 return false;
221 }; 223 };
222 return ResultSet(generator); 224 return ResultSet(generator);
223} 225}