diff options
Diffstat (limited to 'common/synchronizer.h')
-rw-r--r-- | common/synchronizer.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/common/synchronizer.h b/common/synchronizer.h index b1ee122..bb24c2b 100644 --- a/common/synchronizer.h +++ b/common/synchronizer.h | |||
@@ -131,6 +131,8 @@ protected: | |||
131 | RequestFlush | 131 | RequestFlush |
132 | }; | 132 | }; |
133 | 133 | ||
134 | SyncRequest() = default; | ||
135 | |||
134 | SyncRequest(const Sink::QueryBase &q, const QByteArray &requestId_ = QByteArray(), RequestOptions o = NoOptions) | 136 | SyncRequest(const Sink::QueryBase &q, const QByteArray &requestId_ = QByteArray(), RequestOptions o = NoOptions) |
135 | : requestId(requestId_), | 137 | : requestId(requestId_), |
136 | requestType(Synchronization), | 138 | requestType(Synchronization), |
@@ -145,6 +147,12 @@ protected: | |||
145 | { | 147 | { |
146 | } | 148 | } |
147 | 149 | ||
150 | SyncRequest(RequestType type, const QByteArray &requestId_) | ||
151 | : requestId(requestId_), | ||
152 | requestType(type) | ||
153 | { | ||
154 | } | ||
155 | |||
148 | SyncRequest(RequestType type, int flushType_, const QByteArray &requestId_) | 156 | SyncRequest(RequestType type, int flushType_, const QByteArray &requestId_) |
149 | : flushType(flushType_), | 157 | : flushType(flushType_), |
150 | requestId(requestId_), | 158 | requestId(requestId_), |
@@ -184,6 +192,7 @@ protected: | |||
184 | virtual void mergeIntoQueue(const Synchronizer::SyncRequest &request, QList<Synchronizer::SyncRequest> &queue); | 192 | virtual void mergeIntoQueue(const Synchronizer::SyncRequest &request, QList<Synchronizer::SyncRequest> &queue); |
185 | 193 | ||
186 | void emitNotification(Notification::NoticationType type, int code, const QString &message, const QByteArray &id = QByteArray{}, const QByteArrayList &entiteis = QByteArrayList{}); | 194 | void emitNotification(Notification::NoticationType type, int code, const QString &message, const QByteArray &id = QByteArray{}, const QByteArrayList &entiteis = QByteArrayList{}); |
195 | void emitProgressNotification(Notification::NoticationType type, int progress, int total, const QByteArray &id, const QByteArrayList &entities); | ||
187 | 196 | ||
188 | /** | 197 | /** |
189 | * Report progress for current task | 198 | * Report progress for current task |
@@ -211,6 +220,7 @@ private: | |||
211 | Sink::Storage::DataStore::Transaction mSyncTransaction; | 220 | Sink::Storage::DataStore::Transaction mSyncTransaction; |
212 | std::function<void(int commandId, const QByteArray &data)> mEnqueue; | 221 | std::function<void(int commandId, const QByteArray &data)> mEnqueue; |
213 | QList<SyncRequest> mSyncRequestQueue; | 222 | QList<SyncRequest> mSyncRequestQueue; |
223 | SyncRequest mCurrentRequest; | ||
214 | MessageQueue *mMessageQueue; | 224 | MessageQueue *mMessageQueue; |
215 | bool mSyncInProgress; | 225 | bool mSyncInProgress; |
216 | QMultiHash<QByteArray, SyncRequest> mPendingSyncRequests; | 226 | QMultiHash<QByteArray, SyncRequest> mPendingSyncRequests; |