diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-10-06 16:19:51 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-10-10 10:40:01 +0200 |
commit | f689ad1021a7805f6f8b6a81f534b4cb9ca91f51 (patch) | |
tree | c18d746b775279f143c8d8052924bb4d83fbb91f /common/genericresource.cpp | |
parent | c3f6e72c2d46906a4699127b558ca248729ce577 (diff) | |
download | sink-f689ad1021a7805f6f8b6a81f534b4cb9ca91f51.tar.gz sink-f689ad1021a7805f6f8b6a81f534b4cb9ca91f51.zip |
Change replay
So far only includes modifications and additions,
removals are not yet stored as separate revisions.
Diffstat (limited to 'common/genericresource.cpp')
-rw-r--r-- | common/genericresource.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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 | |||
204 | void GenericResource::processCommand(int commandId, const QByteArray &data) | 204 | void GenericResource::processCommand(int commandId, const QByteArray &data) |
205 | { | 205 | { |
206 | static int modifications = 0; | 206 | static int modifications = 0; |
207 | const int batchSize = 100; | ||
207 | mUserQueue.startTransaction(); | 208 | mUserQueue.startTransaction(); |
208 | enqueueCommand(mUserQueue, commandId, data); | 209 | enqueueCommand(mUserQueue, commandId, data); |
209 | modifications++; | 210 | modifications++; |
210 | if (modifications >= 100) { | 211 | if (modifications >= batchSize) { |
211 | mUserQueue.commit(); | 212 | mUserQueue.commit(); |
212 | modifications = 0; | 213 | modifications = 0; |
213 | mCommitQueueTimer.stop(); | 214 | mCommitQueueTimer.stop(); |