From dd6196206f87086a636677da55cf5c300a8e932a Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 19 Jan 2015 19:26:14 +0100 Subject: Fixed sync, detect errors during sync, wait until sync items are processed until signalling completion. --- common/messagequeue.cpp | 3 +++ common/messagequeue.h | 1 + common/pipeline.cpp | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'common') 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::functiondrained(); + } } else { //TODO re-enqueue? } 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: bool isEmpty(); signals: void messageReady(); + void drained(); private: 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 Pipeline::newEntity(void const *command, size_t size) flatbuffers::Verifier verifyer(reinterpret_cast(command), size); if (!Akonadi2::Commands::VerifyCreateEntityBuffer(verifyer)) { qWarning() << "invalid buffer, not a create entity buffer"; - return Async::null(); + return Async::error(); } } auto createEntity = Akonadi2::Commands::GetCreateEntity(command); @@ -118,7 +118,7 @@ Async::Job Pipeline::newEntity(void const *command, size_t size) flatbuffers::Verifier verifyer(reinterpret_cast(createEntity->delta()->Data()), createEntity->delta()->size()); if (!Akonadi2::VerifyEntityBuffer(verifyer)) { qWarning() << "invalid buffer, not an entity buffer"; - return Async::null(); + return Async::error(); } } auto entity = Akonadi2::GetEntity(createEntity->delta()->Data()); -- cgit v1.2.3