- Added CDBusServer into Blackcore library
- Added DBus server and client sample
This commit is contained in:
Roland Winklmeier
2013-07-22 22:44:00 +02:00
parent 1c5293f38f
commit 40abcf4c19
28 changed files with 729 additions and 1 deletions

View File

@@ -0,0 +1,33 @@
#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();
}