diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/messagequeue.cpp | 3 | ||||
-rw-r--r-- | common/messagequeue.h | 1 | ||||
-rw-r--r-- | common/pipeline.cpp | 4 |
3 files changed, 6 insertions, 2 deletions
diff --git a/common/messagequeue.cpp b/common/messagequeue.cpp index 99a0112..3754b16 100644 --- a/common/messagequeue.cpp +++ b/common/messagequeue.cpp | |||
@@ -31,6 +31,9 @@ void MessageQueue::dequeue(const std::function<void(void *ptr, int size, std::fu | |||
31 | resultHandler(valuePtr, valueSize, [this, key](bool success) { | 31 | resultHandler(valuePtr, valueSize, [this, key](bool success) { |
32 | if (success) { | 32 | if (success) { |
33 | mStorage.remove(key.data(), key.size()); | 33 | mStorage.remove(key.data(), key.size()); |
34 | if (isEmpty()) { | ||
35 | emit this->drained(); | ||
36 | } | ||
34 | } else { | 37 | } else { |
35 | //TODO re-enqueue? | 38 | //TODO re-enqueue? |
36 | } | 39 | } |
diff --git a/common/messagequeue.h b/common/messagequeue.h index 0b791c6..52eeb1f 100644 --- a/common/messagequeue.h +++ b/common/messagequeue.h | |||
@@ -34,6 +34,7 @@ public: | |||
34 | bool isEmpty(); | 34 | bool isEmpty(); |
35 | signals: | 35 | signals: |
36 | void messageReady(); | 36 | void messageReady(); |
37 | void drained(); | ||
37 | 38 | ||
38 | private: | 39 | private: |
39 | Q_DISABLE_COPY(MessageQueue); | 40 | Q_DISABLE_COPY(MessageQueue); |
diff --git a/common/pipeline.cpp b/common/pipeline.cpp index 8f15fef..13a3344 100644 --- a/common/pipeline.cpp +++ b/common/pipeline.cpp | |||
@@ -107,7 +107,7 @@ Async::Job<void> Pipeline::newEntity(void const *command, size_t size) | |||
107 | flatbuffers::Verifier verifyer(reinterpret_cast<const uint8_t *>(command), size); | 107 | flatbuffers::Verifier verifyer(reinterpret_cast<const uint8_t *>(command), size); |
108 | if (!Akonadi2::Commands::VerifyCreateEntityBuffer(verifyer)) { | 108 | if (!Akonadi2::Commands::VerifyCreateEntityBuffer(verifyer)) { |
109 | qWarning() << "invalid buffer, not a create entity buffer"; | 109 | qWarning() << "invalid buffer, not a create entity buffer"; |
110 | return Async::null<void>(); | 110 | return Async::error<void>(); |
111 | } | 111 | } |
112 | } | 112 | } |
113 | auto createEntity = Akonadi2::Commands::GetCreateEntity(command); | 113 | auto createEntity = Akonadi2::Commands::GetCreateEntity(command); |
@@ -118,7 +118,7 @@ Async::Job<void> Pipeline::newEntity(void const *command, size_t size) | |||
118 | flatbuffers::Verifier verifyer(reinterpret_cast<const uint8_t *>(createEntity->delta()->Data()), createEntity->delta()->size()); | 118 | flatbuffers::Verifier verifyer(reinterpret_cast<const uint8_t *>(createEntity->delta()->Data()), createEntity->delta()->size()); |
119 | if (!Akonadi2::VerifyEntityBuffer(verifyer)) { | 119 | if (!Akonadi2::VerifyEntityBuffer(verifyer)) { |
120 | qWarning() << "invalid buffer, not an entity buffer"; | 120 | qWarning() << "invalid buffer, not an entity buffer"; |
121 | return Async::null<void>(); | 121 | return Async::error<void>(); |
122 | } | 122 | } |
123 | } | 123 | } |
124 | auto entity = Akonadi2::GetEntity(createEntity->delta()->Data()); | 124 | auto entity = Akonadi2::GetEntity(createEntity->delta()->Data()); |