summaryrefslogtreecommitdiffstats
path: root/common/synclistresult.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/synclistresult.h')
-rw-r--r--common/synclistresult.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/common/synclistresult.h b/common/synclistresult.h
index 865d3e0..3ae2bed 100644
--- a/common/synclistresult.h
+++ b/common/synclistresult.h
@@ -4,6 +4,7 @@
4#include <functional> 4#include <functional>
5#include <QSharedPointer> 5#include <QSharedPointer>
6#include <QEventLoop> 6#include <QEventLoop>
7#include <QDebug>
7#include "resultprovider.h" 8#include "resultprovider.h"
8 9
9namespace async { 10namespace async {
@@ -25,6 +26,23 @@ public:
25 emitter->onAdded([this](const T &value) { 26 emitter->onAdded([this](const T &value) {
26 this->append(value); 27 this->append(value);
27 }); 28 });
29 emitter->onModified([this](const T &value) {
30 for (auto it = this->begin(); it != this->end(); it++) {
31 if (**it == *value) {
32 it = this->erase(it);
33 this->insert(it, value);
34 break;
35 }
36 }
37 });
38 emitter->onRemoved([this](const T &value) {
39 for (auto it = this->begin(); it != this->end(); it++) {
40 if (**it == *value) {
41 this->erase(it);
42 break;
43 }
44 }
45 });
28 emitter->onInitialResultSetComplete([this]() { 46 emitter->onInitialResultSetComplete([this]() {
29 if (eventLoopAborter) { 47 if (eventLoopAborter) {
30 eventLoopAborter(); 48 eventLoopAborter();