summaryrefslogtreecommitdiffstats
path: root/common/synchronizer.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/synchronizer.h')
-rw-r--r--common/synchronizer.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/common/synchronizer.h b/common/synchronizer.h
index 4d5bdd5..99d4877 100644
--- a/common/synchronizer.h
+++ b/common/synchronizer.h
@@ -45,6 +45,7 @@ public:
45 45
46 void setup(const std::function<void(int commandId, const QByteArray &data)> &enqueueCommandCallback, MessageQueue &messageQueue); 46 void setup(const std::function<void(int commandId, const QByteArray &data)> &enqueueCommandCallback, MessageQueue &messageQueue);
47 KAsync::Job<void> synchronize(const Sink::QueryBase &query); 47 KAsync::Job<void> synchronize(const Sink::QueryBase &query);
48 void flush(int commandId, const QByteArray &flushId);
48 49
49 //Read only access to main storage 50 //Read only access to main storage
50 Storage::EntityStore &store(); 51 Storage::EntityStore &store();
@@ -57,6 +58,9 @@ public:
57 58
58 bool allChangesReplayed() Q_DECL_OVERRIDE; 59 bool allChangesReplayed() Q_DECL_OVERRIDE;
59 60
61signals:
62 void notify(Notification);
63
60public slots: 64public slots:
61 virtual void revisionChanged() Q_DECL_OVERRIDE; 65 virtual void revisionChanged() Q_DECL_OVERRIDE;
62 66
@@ -115,23 +119,30 @@ protected:
115 struct SyncRequest { 119 struct SyncRequest {
116 enum RequestType { 120 enum RequestType {
117 Synchronization, 121 Synchronization,
118 ChangeReplay 122 ChangeReplay,
123 Flush
119 }; 124 };
120 125
121 SyncRequest(const Sink::QueryBase &q) 126 SyncRequest(const Sink::QueryBase &q)
122 : flushQueue(false), 127 : requestType(Synchronization),
123 requestType(Synchronization),
124 query(q) 128 query(q)
125 { 129 {
126 } 130 }
127 131
128 SyncRequest(RequestType type) 132 SyncRequest(RequestType type)
129 : flushQueue(false), 133 : requestType(type)
134 {
135 }
136
137 SyncRequest(RequestType type, int flushType_, const QByteArray &flushId_)
138 : flushType(flushType_),
139 flushId(flushId_),
130 requestType(type) 140 requestType(type)
131 { 141 {
132 } 142 }
133 143
134 bool flushQueue; 144 int flushType = 0;
145 QByteArray flushId;
135 RequestType requestType; 146 RequestType requestType;
136 Sink::QueryBase query; 147 Sink::QueryBase query;
137 }; 148 };