diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-07-16 13:29:59 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-07-16 13:29:59 +0200 |
commit | 3410ca3f15c07d6f19f1165b50ef4f1a42599164 (patch) | |
tree | bf5b1575696682b8c85e9ae522c6e4339e3e93a1 /common | |
parent | 4b0b2abf9c9b2d57f79388064ccc95888c1cb039 (diff) | |
download | sink-3410ca3f15c07d6f19f1165b50ef4f1a42599164.tar.gz sink-3410ca3f15c07d6f19f1165b50ef4f1a42599164.zip |
Deal with modifications to filtered entities
Diffstat (limited to 'common')
-rw-r--r-- | common/datastorequery.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/common/datastorequery.cpp b/common/datastorequery.cpp index 4c25710..aca4bb1 100644 --- a/common/datastorequery.cpp +++ b/common/datastorequery.cpp | |||
@@ -359,9 +359,12 @@ public: | |||
359 | //Redo the reduction to find new aggregated values | 359 | //Redo the reduction to find new aggregated values |
360 | auto selectionResult = reduceOnValue(reductionValue); | 360 | auto selectionResult = reduceOnValue(reductionValue); |
361 | 361 | ||
362 | //If mSelectedValues did not contain the value, oldSelectionResult will be empty.(Happens if entites have been filtered) | ||
362 | auto oldSelectionResult = mSelectedValues.take(reductionValueBa); | 363 | auto oldSelectionResult = mSelectedValues.take(reductionValueBa); |
363 | SinkTraceCtx(mDatastore->mLogCtx) << "Old selection result: " << oldSelectionResult << " New selection result: " << selectionResult.selection; | 364 | SinkTraceCtx(mDatastore->mLogCtx) << "Old selection result: " << oldSelectionResult << " New selection result: " << selectionResult.selection; |
364 | if (oldSelectionResult == selectionResult.selection) { | 365 | if (selectionResult.selection.isEmpty() && oldSelectionResult.isEmpty()) { |
366 | //Nothing to do, the item was filtered before, and still is. | ||
367 | } else if (oldSelectionResult == selectionResult.selection) { | ||
365 | mSelectedValues.insert(reductionValueBa, selectionResult.selection); | 368 | mSelectedValues.insert(reductionValueBa, selectionResult.selection); |
366 | Q_ASSERT(!selectionResult.selection.isEmpty()); | 369 | Q_ASSERT(!selectionResult.selection.isEmpty()); |
367 | readEntity(selectionResult.selection, [&](const Sink::ApplicationDomain::ApplicationDomainType &entity, Sink::Operation) { | 370 | readEntity(selectionResult.selection, [&](const Sink::ApplicationDomain::ApplicationDomainType &entity, Sink::Operation) { |
@@ -369,7 +372,6 @@ public: | |||
369 | }); | 372 | }); |
370 | } else { | 373 | } else { |
371 | //remove old result | 374 | //remove old result |
372 | //If mSelectedValues did not containthe value, oldSelectionResult will be empty.(Happens if entites have been filtered) | ||
373 | if (!oldSelectionResult.isEmpty()) { | 375 | if (!oldSelectionResult.isEmpty()) { |
374 | readEntity(oldSelectionResult, [&](const Sink::ApplicationDomain::ApplicationDomainType &entity, Sink::Operation) { | 376 | readEntity(oldSelectionResult, [&](const Sink::ApplicationDomain::ApplicationDomainType &entity, Sink::Operation) { |
375 | callback({entity, Sink::Operation_Removal}); | 377 | callback({entity, Sink::Operation_Removal}); |