summaryrefslogtreecommitdiffstats
path: root/common/queryrunner.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/queryrunner.cpp')
-rw-r--r--common/queryrunner.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/common/queryrunner.cpp b/common/queryrunner.cpp
index 1835e1f..f037cfc 100644
--- a/common/queryrunner.cpp
+++ b/common/queryrunner.cpp
@@ -55,7 +55,7 @@ public:
55 55
56private: 56private:
57 Storage::Transaction getTransaction(); 57 Storage::Transaction getTransaction();
58 std::function<bool(const typename DomainType::Ptr &, Sink::Operation)> resultProviderCallback(const Sink::Query &query, Sink::ResultProviderInterface<typename DomainType::Ptr> &resultProvider); 58 std::function<bool(const typename DomainType::Ptr &, Sink::Operation, const QMap<QByteArray, QVariant> &)> resultProviderCallback(const Sink::Query &query, Sink::ResultProviderInterface<typename DomainType::Ptr> &resultProvider);
59 59
60 QueryRunnerBase::ResultTransformation mResultTransformation; 60 QueryRunnerBase::ResultTransformation mResultTransformation;
61 DomainTypeAdaptorFactoryInterface::Ptr mDomainTypeAdaptorFactory; 61 DomainTypeAdaptorFactoryInterface::Ptr mDomainTypeAdaptorFactory;
@@ -174,10 +174,13 @@ QueryWorker<DomainType>::~QueryWorker()
174} 174}
175 175
176template <class DomainType> 176template <class DomainType>
177std::function<bool(const typename DomainType::Ptr &, Sink::Operation)> QueryWorker<DomainType>::resultProviderCallback(const Sink::Query &query, Sink::ResultProviderInterface<typename DomainType::Ptr> &resultProvider) 177std::function<bool(const typename DomainType::Ptr &, Sink::Operation, const QMap<QByteArray, QVariant> &)> QueryWorker<DomainType>::resultProviderCallback(const Sink::Query &query, Sink::ResultProviderInterface<typename DomainType::Ptr> &resultProvider)
178{ 178{
179 return [this, &query, &resultProvider](const typename DomainType::Ptr &domainObject, Sink::Operation operation) -> bool { 179 return [this, &query, &resultProvider](const typename DomainType::Ptr &domainObject, Sink::Operation operation, const QMap<QByteArray, QVariant> &aggregateValues) -> bool {
180 auto valueCopy = Sink::ApplicationDomain::ApplicationDomainType::getInMemoryRepresentation<DomainType>(*domainObject, query.requestedProperties).template staticCast<DomainType>(); 180 auto valueCopy = Sink::ApplicationDomain::ApplicationDomainType::getInMemoryRepresentation<DomainType>(*domainObject, query.requestedProperties).template staticCast<DomainType>();
181 for (auto it = aggregateValues.constBegin(); it != aggregateValues.constEnd(); it++) {
182 valueCopy->setProperty(it.key(), it.value());
183 }
181 if (mResultTransformation) { 184 if (mResultTransformation) {
182 mResultTransformation(*valueCopy); 185 mResultTransformation(*valueCopy);
183 } 186 }