From 721a3a6a415b8137967c9c0da4a6f6db8cb61202 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Fri, 3 Apr 2015 00:16:39 +0200 Subject: Continue processing if there are more messages. --- dummyresource/resourcefactory.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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: signals: void error(int errorCode, const QString &errorMessage); +private: + bool messagesToProcessAvailable() + { + for (auto queue : mCommandQueues) { + if (!queue->isEmpty()) { + return true; + } + } + return false; + } + private slots: void process() { @@ -131,6 +142,9 @@ private slots: mProcessingLock = true; auto job = processPipeline().then([this]() { mProcessingLock = false; + if (messagesToProcessAvailable()) { + process(); + } }).exec(); } -- cgit v1.2.3