summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-10-27 11:10:34 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-10-27 11:10:55 +0200
commitf4b6a6e2e9a2bc170249cb309bfb4df66f98bb14 (patch)
tree0204261bf9cdac8a96e2960d98a62993bbdd423f
parentb53285776341f5bb5ea1a375a5d448620b8f8ea2 (diff)
downloadsink-f4b6a6e2e9a2bc170249cb309bfb4df66f98bb14.tar.gz
sink-f4b6a6e2e9a2bc170249cb309bfb4df66f98bb14.zip
Reset aggregation when we get to a new value.
Otherwise i.e. the counter will only ever count up
-rw-r--r--common/datastorequery.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/common/datastorequery.cpp b/common/datastorequery.cpp
index ff255f4..aa7b772 100644
--- a/common/datastorequery.cpp
+++ b/common/datastorequery.cpp
@@ -172,6 +172,11 @@ public:
172 } 172 }
173 } 173 }
174 174
175 void reset()
176 {
177 mResult.clear();
178 }
179
175 QVariant result() const 180 QVariant result() const
176 { 181 {
177 return mResult; 182 return mResult;
@@ -225,6 +230,9 @@ public:
225 QVariant selectionResultValue; 230 QVariant selectionResultValue;
226 QByteArray selectionResult; 231 QByteArray selectionResult;
227 auto results = indexLookup(mReductionProperty, reductionValue); 232 auto results = indexLookup(mReductionProperty, reductionValue);
233 for (auto &aggregator : mAggregators) {
234 aggregator.reset();
235 }
228 236
229 QVariantList list; 237 QVariantList list;
230 for (const auto r : results) { 238 for (const auto r : results) {