From 6adf9a4734f15a2c0fa199897f76ded4659b83b7 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 4 May 2017 11:40:24 +0200 Subject: Added progress notification --- common/synchronizer.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'common/synchronizer.h') 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: RequestFlush }; + SyncRequest() = default; + SyncRequest(const Sink::QueryBase &q, const QByteArray &requestId_ = QByteArray(), RequestOptions o = NoOptions) : requestId(requestId_), requestType(Synchronization), @@ -145,6 +147,12 @@ protected: { } + SyncRequest(RequestType type, const QByteArray &requestId_) + : requestId(requestId_), + requestType(type) + { + } + SyncRequest(RequestType type, int flushType_, const QByteArray &requestId_) : flushType(flushType_), requestId(requestId_), @@ -184,6 +192,7 @@ protected: virtual void mergeIntoQueue(const Synchronizer::SyncRequest &request, QList &queue); void emitNotification(Notification::NoticationType type, int code, const QString &message, const QByteArray &id = QByteArray{}, const QByteArrayList &entiteis = QByteArrayList{}); + void emitProgressNotification(Notification::NoticationType type, int progress, int total, const QByteArray &id, const QByteArrayList &entities); /** * Report progress for current task @@ -211,6 +220,7 @@ private: Sink::Storage::DataStore::Transaction mSyncTransaction; std::function mEnqueue; QList mSyncRequestQueue; + SyncRequest mCurrentRequest; MessageQueue *mMessageQueue; bool mSyncInProgress; QMultiHash mPendingSyncRequests; -- cgit v1.2.3