mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-29 12:45:40 +08:00
Ref T259, error message if proxy signal cannot be connected
Do not relay some signals
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
#ifndef BLACKMISC_GENERICDBUSINTERFACE_H
|
#ifndef BLACKMISC_GENERICDBUSINTERFACE_H
|
||||||
#define BLACKMISC_GENERICDBUSINTERFACE_H
|
#define BLACKMISC_GENERICDBUSINTERFACE_H
|
||||||
|
|
||||||
|
#include "logmessage.h"
|
||||||
#include <QDBusAbstractInterface>
|
#include <QDBusAbstractInterface>
|
||||||
#include <QDBusPendingCall>
|
#include <QDBusPendingCall>
|
||||||
#include <QDBusPendingReply>
|
#include <QDBusPendingReply>
|
||||||
@@ -50,12 +51,16 @@ namespace BlackMisc
|
|||||||
|
|
||||||
for (int i = superMetaObject->methodOffset(), count = metaObject->methodCount(); i < count; ++i)
|
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.methodType() != QMetaMethod::Signal) { continue; }
|
||||||
if (method.tag() && strcmp(method.tag(), "BLACK_NO_RELAY") == 0) { 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(),
|
const QByteArray signature = method.methodSignature().prepend("2"); // the reason for this "2" can be found in the definition of SIGNAL() macro
|
||||||
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ namespace BlackSimPlugin
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
//! Emitted if an asynchronous method call caused a DBus error
|
//! 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
|
//! \copydoc XSwiftBus::CService::aircraftModelChanged
|
||||||
void aircraftModelChanged(
|
void aircraftModelChanged(
|
||||||
|
|||||||
Reference in New Issue
Block a user