diff options
Diffstat (limited to 'common/datastorequery.cpp')
-rw-r--r-- | common/datastorequery.cpp | 14 |
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()) { |