diff --git a/src/blackmisc/genericdbusinterface.h b/src/blackmisc/genericdbusinterface.h index 81f1845b6..113626ce8 100644 --- a/src/blackmisc/genericdbusinterface.h +++ b/src/blackmisc/genericdbusinterface.h @@ -12,6 +12,7 @@ #ifndef BLACKMISC_GENERICDBUSINTERFACE_H #define BLACKMISC_GENERICDBUSINTERFACE_H +#include "logmessage.h" #include #include #include @@ -50,12 +51,16 @@ namespace BlackMisc for (int i = superMetaObject->methodOffset(), count = metaObject->methodCount(); i < count; ++i) { - QMetaMethod method = metaObject->method(i); + const QMetaMethod method = metaObject->method(i); if (method.methodType() != QMetaMethod::Signal) { continue; } if (method.tag() && strcmp(method.tag(), "BLACK_NO_RELAY") == 0) { continue; } - this->connection().connect(this->service(), this->path(), this->interface(), method.name(), this->parent(), - method.methodSignature().prepend("2")); // the reason for this "2" can be found in the definition of SIGNAL() macro + const QByteArray signature = method.methodSignature().prepend("2"); // the reason for this "2" can be found in the definition of SIGNAL() macro + const bool c = this->connection().connect(this->service(), this->path(), this->interface(), method.name(), this->parent(), signature); + if (!c) + { + CLogMessage(this).error("Cannot connect signal: %1") << QString(signature); + } } } diff --git a/src/plugins/simulator/xplane/xswiftbusserviceproxy.h b/src/plugins/simulator/xplane/xswiftbusserviceproxy.h index f070eaf29..f72c0450a 100644 --- a/src/plugins/simulator/xplane/xswiftbusserviceproxy.h +++ b/src/plugins/simulator/xplane/xswiftbusserviceproxy.h @@ -83,7 +83,7 @@ namespace BlackSimPlugin signals: //! Emitted if an asynchronous method call caused a DBus error - void asyncMethodError(QDBusError error); + BLACK_NO_RELAY void asyncMethodError(QDBusError error); //! \copydoc XSwiftBus::CService::aircraftModelChanged void aircraftModelChanged(