From f4b6a6e2e9a2bc170249cb309bfb4df66f98bb14 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 27 Oct 2016 11:10:34 +0200 Subject: Reset aggregation when we get to a new value. Otherwise i.e. the counter will only ever count up --- common/datastorequery.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'common/datastorequery.cpp') 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: } } + void reset() + { + mResult.clear(); + } + QVariant result() const { return mResult; @@ -225,6 +230,9 @@ public: QVariant selectionResultValue; QByteArray selectionResult; auto results = indexLookup(mReductionProperty, reductionValue); + for (auto &aggregator : mAggregators) { + aggregator.reset(); + } QVariantList list; for (const auto r : results) { -- cgit v1.2.3