Connect XSwiftBus signals manually in the proxy

This way we can check the return value and make sure that it is properly
connected.

ref T291
This commit is contained in:
Roland Winklmeier
2018-07-26 17:28:16 +02:00
committed by Klaus Basan
parent ef8c7d7d1c
commit f881b118b6
2 changed files with 28 additions and 2 deletions

View File

@@ -24,7 +24,21 @@ namespace BlackSimPlugin
CXSwiftBusTrafficProxy::CXSwiftBusTrafficProxy(QDBusConnection &connection, QObject *parent, bool dummy) : QObject(parent)
{
m_dbusInterface = new BlackMisc::CGenericDBusInterface(XSWIFTBUS_SERVICENAME, ObjectPath(), InterfaceName(), connection, this);
if (!dummy) { m_dbusInterface->relayParentSignals(); }
if (!dummy)
{
bool s;
s = connection.connect(QString(), "/xswiftbus/traffic", "org.swift_project.xswiftbus.traffic",
"simFrame", this, SIGNAL(simFrame()));
Q_ASSERT(s);
s = connection.connect(QString(), "/xswiftbus/traffic", "org.swift_project.xswiftbus.traffic",
"remoteAircraftAdded", this, SIGNAL(remoteAircraftAdded(QString)));
Q_ASSERT(s);
s = connection.connect(QString(), "/xswiftbus/traffic", "org.swift_project.xswiftbus.traffic",
"remoteAircraftAddingFailed", this, SIGNAL(remoteAircraftAddingFailed(QString)));
Q_ASSERT(s);
}
}
bool CXSwiftBusTrafficProxy::initialize()