summaryrefslogtreecommitdiffstats
path: root/common/datastorequery.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/datastorequery.cpp')
-rw-r--r--common/datastorequery.cpp27
1 files changed, 17 insertions, 10 deletions
diff --git a/common/datastorequery.cpp b/common/datastorequery.cpp
index 3ba8f40..34d2bae 100644
--- a/common/datastorequery.cpp
+++ b/common/datastorequery.cpp
@@ -288,16 +288,23 @@ public:
288 288
289 //TODO if old and new are the same a modification would be enough 289 //TODO if old and new are the same a modification would be enough
290 auto oldSelectionResult = mSelectedValues.take(reductionValueBa); 290 auto oldSelectionResult = mSelectedValues.take(reductionValueBa);
291 //remove old result 291 if (oldSelectionResult == selectionResult) {
292 readEntity(oldSelectionResult, [&, this](const Sink::ApplicationDomain::ApplicationDomainType &entity, Sink::Operation) { 292 mSelectedValues.insert(reductionValueBa, selectionResult);
293 callback({entity, Sink::Operation_Removal}); 293 readEntity(selectionResult, [&, this](const Sink::ApplicationDomain::ApplicationDomainType &entity, Sink::Operation) {
294 }); 294 callback({entity, Sink::Operation_Modification, aggregateValues});
295 295 });
296 //add new result 296 } else {
297 mSelectedValues.insert(reductionValueBa, selectionResult); 297 //remove old result
298 readEntity(selectionResult, [&, this](const Sink::ApplicationDomain::ApplicationDomainType &entity, Sink::Operation) { 298 readEntity(oldSelectionResult, [&, this](const Sink::ApplicationDomain::ApplicationDomainType &entity, Sink::Operation) {
299 callback({entity, Sink::Operation_Creation, aggregateValues}); 299 callback({entity, Sink::Operation_Removal});
300 }); 300 });
301
302 //add new result
303 mSelectedValues.insert(reductionValueBa, selectionResult);
304 readEntity(selectionResult, [&, this](const Sink::ApplicationDomain::ApplicationDomainType &entity, Sink::Operation) {
305 callback({entity, Sink::Operation_Creation, aggregateValues});
306 });
307 }
301 } 308 }
302 } 309 }
303 return false; 310 return false;