mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
34 lines
947 B
C++
34 lines
947 B
C++
#include <QDebug>
|
|
#include "planemanagerhandler.h"
|
|
|
|
// It is really IMPORTANT to include this header.
|
|
// Otherwise it won't be generated by qmake and the
|
|
// project can't be build
|
|
#include "planemanager_adaptor.h"
|
|
|
|
CPlaneManagerHandler::CPlaneManagerHandler(QObject *parent) :
|
|
QObject(parent), m_dbusserver(0), m_parent(0)
|
|
{
|
|
m_dbusPath = "/PlaneManager";
|
|
m_parent = qobject_cast<CPlaneManager *>(parent);
|
|
|
|
new PlaneManagerAdaptor(this);
|
|
|
|
}
|
|
|
|
void CPlaneManagerHandler::setDBusServer(BlackCore::CDBusServer *dbusServer)
|
|
{
|
|
m_dbusserver = dbusServer;
|
|
|
|
// We add ourselves to the DBus server. This is needed, because
|
|
// DBus has to register all exposed objects for each new connection
|
|
if (m_dbusserver)
|
|
m_dbusserver->addObject(m_dbusPath, this);
|
|
}
|
|
|
|
QStringList CPlaneManagerHandler::pilotList() const
|
|
{
|
|
qDebug() << "Somebody requested the list of pilots. Here you go...";
|
|
return m_parent->pilotList();
|
|
}
|