summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2018-07-02 14:33:21 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-07-02 14:34:07 +0200
commitce7c9ae13defe17f0966638d63d9f7f55806ac76 (patch)
tree5e4d28bfd7d14d42c00ed5e2d6ec3292c4b2d25d /common
parent0207fc55ee236d8c57a9896ebd4defc4d55369ce (diff)
downloadsink-ce7c9ae13defe17f0966638d63d9f7f55806ac76.tar.gz
sink-ce7c9ae13defe17f0966638d63d9f7f55806ac76.zip
Fixed yet another reduction update codepath
Diffstat (limited to 'common')
-rw-r--r--common/datastorequery.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/common/datastorequery.cpp b/common/datastorequery.cpp
index fd910f8..4c25710 100644
--- a/common/datastorequery.cpp
+++ b/common/datastorequery.cpp
@@ -361,10 +361,6 @@ public:
361 361
362 auto oldSelectionResult = mSelectedValues.take(reductionValueBa); 362 auto oldSelectionResult = mSelectedValues.take(reductionValueBa);
363 SinkTraceCtx(mDatastore->mLogCtx) << "Old selection result: " << oldSelectionResult << " New selection result: " << selectionResult.selection; 363 SinkTraceCtx(mDatastore->mLogCtx) << "Old selection result: " << oldSelectionResult << " New selection result: " << selectionResult.selection;
364 //If mSelectedValues did not containthe value, oldSelectionResult will be empty.(Happens if entites have been filtered)
365 if (oldSelectionResult.isEmpty()) {
366 return;
367 }
368 if (oldSelectionResult == selectionResult.selection) { 364 if (oldSelectionResult == selectionResult.selection) {
369 mSelectedValues.insert(reductionValueBa, selectionResult.selection); 365 mSelectedValues.insert(reductionValueBa, selectionResult.selection);
370 Q_ASSERT(!selectionResult.selection.isEmpty()); 366 Q_ASSERT(!selectionResult.selection.isEmpty());
@@ -373,10 +369,12 @@ public:
373 }); 369 });
374 } else { 370 } else {
375 //remove old result 371 //remove old result
376 Q_ASSERT(!oldSelectionResult.isEmpty()); 372 //If mSelectedValues did not containthe value, oldSelectionResult will be empty.(Happens if entites have been filtered)
377 readEntity(oldSelectionResult, [&](const Sink::ApplicationDomain::ApplicationDomainType &entity, Sink::Operation) { 373 if (!oldSelectionResult.isEmpty()) {
378 callback({entity, Sink::Operation_Removal}); 374 readEntity(oldSelectionResult, [&](const Sink::ApplicationDomain::ApplicationDomainType &entity, Sink::Operation) {
379 }); 375 callback({entity, Sink::Operation_Removal});
376 });
377 }
380 378
381 //If the last item has been removed, then there's nothing to add 379 //If the last item has been removed, then there's nothing to add
382 if (!selectionResult.selection.isEmpty()) { 380 if (!selectionResult.selection.isEmpty()) {