diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-04-03 00:16:39 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-04-03 00:16:39 +0200 |
commit | 721a3a6a415b8137967c9c0da4a6f6db8cb61202 (patch) | |
tree | dbb8cd41708b00a874094a6f4d900daa6e593263 | |
parent | f46e1f6775b5e052ebe12f9db2eb211d1622274b (diff) | |
download | sink-721a3a6a415b8137967c9c0da4a6f6db8cb61202.tar.gz sink-721a3a6a415b8137967c9c0da4a6f6db8cb61202.zip |
Continue processing if there are more messages.
-rw-r--r-- | dummyresource/resourcefactory.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/dummyresource/resourcefactory.cpp b/dummyresource/resourcefactory.cpp index 9d702a8..d94284c 100644 --- a/dummyresource/resourcefactory.cpp +++ b/dummyresource/resourcefactory.cpp | |||
@@ -122,6 +122,17 @@ public: | |||
122 | signals: | 122 | signals: |
123 | void error(int errorCode, const QString &errorMessage); | 123 | void error(int errorCode, const QString &errorMessage); |
124 | 124 | ||
125 | private: | ||
126 | bool messagesToProcessAvailable() | ||
127 | { | ||
128 | for (auto queue : mCommandQueues) { | ||
129 | if (!queue->isEmpty()) { | ||
130 | return true; | ||
131 | } | ||
132 | } | ||
133 | return false; | ||
134 | } | ||
135 | |||
125 | private slots: | 136 | private slots: |
126 | void process() | 137 | void process() |
127 | { | 138 | { |
@@ -131,6 +142,9 @@ private slots: | |||
131 | mProcessingLock = true; | 142 | mProcessingLock = true; |
132 | auto job = processPipeline().then<void>([this]() { | 143 | auto job = processPipeline().then<void>([this]() { |
133 | mProcessingLock = false; | 144 | mProcessingLock = false; |
145 | if (messagesToProcessAvailable()) { | ||
146 | process(); | ||
147 | } | ||
134 | }).exec(); | 148 | }).exec(); |
135 | } | 149 | } |
136 | 150 | ||