diff options
Diffstat (limited to 'common/genericresource.cpp')
-rw-r--r-- | common/genericresource.cpp | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/common/genericresource.cpp b/common/genericresource.cpp index b3df389..bbd992b 100644 --- a/common/genericresource.cpp +++ b/common/genericresource.cpp | |||
@@ -106,19 +106,9 @@ private slots: | |||
106 | //KAsync::foreach("pass iterator here").parallel("process value here").join(); | 106 | //KAsync::foreach("pass iterator here").parallel("process value here").join(); |
107 | return KAsync::dowhile( | 107 | return KAsync::dowhile( |
108 | [this, queue](KAsync::Future<bool> &future) { | 108 | [this, queue](KAsync::Future<bool> &future) { |
109 | queue->dequeueBatch(100, [this](void *ptr, int size, std::function<void(bool success)> messageQueueCallback) { | 109 | queue->dequeueBatch(100, [this](const QByteArray &data) { |
110 | Trace() << "Got value"; | 110 | Trace() << "Got value"; |
111 | processQueuedCommand(QByteArray::fromRawData(static_cast<char*>(ptr), size)).then<void>( | 111 | return processQueuedCommand(data); |
112 | [&messageQueueCallback]() { | ||
113 | Trace() << "done"; | ||
114 | messageQueueCallback(true); | ||
115 | }, | ||
116 | [&messageQueueCallback](int errorCode, QString errorMessage) { | ||
117 | //Use false? | ||
118 | //For now we use true to make sure we don't get stuck on messages we fail to process | ||
119 | messageQueueCallback(true); | ||
120 | } | ||
121 | ).exec(); | ||
122 | } | 112 | } |
123 | ).then<void>([&future](){ | 113 | ).then<void>([&future](){ |
124 | future.setValue(true); | 114 | future.setValue(true); |