From f689ad1021a7805f6f8b6a81f534b4cb9ca91f51 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 6 Oct 2015 16:19:51 +0200 Subject: Change replay So far only includes modifications and additions, removals are not yet stored as separate revisions. --- common/genericresource.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'common/genericresource.cpp') diff --git a/common/genericresource.cpp b/common/genericresource.cpp index 4abcecd..acf84c4 100644 --- a/common/genericresource.cpp +++ b/common/genericresource.cpp @@ -204,10 +204,11 @@ void GenericResource::enqueueCommand(MessageQueue &mq, int commandId, const QByt void GenericResource::processCommand(int commandId, const QByteArray &data) { static int modifications = 0; + const int batchSize = 100; mUserQueue.startTransaction(); enqueueCommand(mUserQueue, commandId, data); modifications++; - if (modifications >= 100) { + if (modifications >= batchSize) { mUserQueue.commit(); modifications = 0; mCommitQueueTimer.stop(); -- cgit v1.2.3