diff --git a/ext/libstrawberry-common/core/messagereply.cpp b/ext/libstrawberry-common/core/messagereply.cpp index 98bf1a3d0..3a54e9db8 100644 --- a/ext/libstrawberry-common/core/messagereply.cpp +++ b/ext/libstrawberry-common/core/messagereply.cpp @@ -40,7 +40,7 @@ void _MessageReplyBase::Abort() { finished_ = true; success_ = false; - emit Finished(success_); + emit Finished(); qLog(Debug) << "Releasing ID" << id() << "(aborted)"; semaphore_.release(); diff --git a/ext/libstrawberry-common/core/messagereply.h b/ext/libstrawberry-common/core/messagereply.h index a0f1336ee..2b0fec900 100644 --- a/ext/libstrawberry-common/core/messagereply.h +++ b/ext/libstrawberry-common/core/messagereply.h @@ -20,9 +20,9 @@ #include #include -#include #include #include +#include #include "core/logging.h" @@ -45,7 +45,7 @@ class _MessageReplyBase : public QObject { void Abort(); signals: - void Finished(bool success); + void Finished(); protected: bool finished_; @@ -89,10 +89,8 @@ void MessageReply::SetReply(const MessageType &message) { qLog(Debug) << "Releasing ID" << id() << "(finished)"; semaphore_.release(); - // The signal is not always emitted without this. - QThread::usleep(10); - - emit Finished(success_); + // Delay the signal as workaround to fix the signal periodically not emitted. + QTimer::singleShot(1, this, &_MessageReplyBase::Finished); }