mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 04:45:31 +08:00
refs #485 removed some dependencies from CDBusServer
This commit is contained in:
committed by
Mathew Sutcliffe
parent
a0b7f741ee
commit
1b587c2ee8
@@ -13,7 +13,6 @@
|
|||||||
#ifndef BLACKSAMPLE_SERVICETOOL_H
|
#ifndef BLACKSAMPLE_SERVICETOOL_H
|
||||||
#define BLACKSAMPLE_SERVICETOOL_H
|
#define BLACKSAMPLE_SERVICETOOL_H
|
||||||
|
|
||||||
#include "blackmisc/dbusserver.h"
|
|
||||||
#include "blackmisc/aviation/atcstationlist.h"
|
#include "blackmisc/aviation/atcstationlist.h"
|
||||||
#include "blackmisc/aviation/airportlist.h"
|
#include "blackmisc/aviation/airportlist.h"
|
||||||
#include "blackmisc/network/clientlist.h"
|
#include "blackmisc/network/clientlist.h"
|
||||||
@@ -22,8 +21,9 @@
|
|||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QDBusConnection>
|
#include <QDBusConnection>
|
||||||
|
|
||||||
namespace BlackSample
|
namespace BlackMisc { class CDBusServer; }
|
||||||
{
|
namespace BlackSample {
|
||||||
|
|
||||||
class Testservice; // forward declaration
|
class Testservice; // forward declaration
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
#include "blackcore/contextapplicationproxy.h"
|
#include "blackcore/contextapplicationproxy.h"
|
||||||
#include "blackcore/contextapplicationempty.h"
|
#include "blackcore/contextapplicationempty.h"
|
||||||
#include "blackcore/inputmanager.h"
|
#include "blackcore/inputmanager.h"
|
||||||
|
#include "blackmisc/dbusserver.h"
|
||||||
#include "blackmisc/settingscache.h"
|
#include "blackmisc/settingscache.h"
|
||||||
#include "blackmisc/statusmessage.h"
|
#include "blackmisc/statusmessage.h"
|
||||||
#include "blackmisc/loghandler.h"
|
#include "blackmisc/loghandler.h"
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
#include "contextapplicationimpl.h"
|
#include "contextapplicationimpl.h"
|
||||||
#include "corefacade.h"
|
#include "corefacade.h"
|
||||||
#include "inputmanager.h"
|
#include "inputmanager.h"
|
||||||
|
#include "blackmisc/dbusserver.h"
|
||||||
#include "blackmisc/settingscache.h"
|
#include "blackmisc/settingscache.h"
|
||||||
#include "blackmisc/logmessage.h"
|
#include "blackmisc/logmessage.h"
|
||||||
#include "blackmisc/loghandler.h"
|
#include "blackmisc/loghandler.h"
|
||||||
|
|||||||
@@ -13,9 +13,9 @@
|
|||||||
#include "blackcoreexport.h"
|
#include "blackcoreexport.h"
|
||||||
#include "contextapplication.h"
|
#include "contextapplication.h"
|
||||||
#include "corefacade.h"
|
#include "corefacade.h"
|
||||||
#include "blackmisc/dbusserver.h"
|
|
||||||
#include "blackmisc/identifierlist.h"
|
#include "blackmisc/identifierlist.h"
|
||||||
|
|
||||||
|
namespace BlackMisc { class CDBusServer; }
|
||||||
namespace BlackCore
|
namespace BlackCore
|
||||||
{
|
{
|
||||||
class CCoreFacade;
|
class CCoreFacade;
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include "contextaudioimpl.h"
|
#include "contextaudioimpl.h"
|
||||||
#include "contextaudioproxy.h"
|
#include "contextaudioproxy.h"
|
||||||
#include "contextaudioempty.h"
|
#include "contextaudioempty.h"
|
||||||
|
#include "blackmisc/dbusserver.h"
|
||||||
|
|
||||||
namespace BlackCore
|
namespace BlackCore
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
#include "blackcoreexport.h"
|
#include "blackcoreexport.h"
|
||||||
#include "contextaudio.h"
|
#include "contextaudio.h"
|
||||||
#include "voice.h"
|
#include "voice.h"
|
||||||
#include "blackmisc/dbusserver.h"
|
|
||||||
|
|
||||||
namespace BlackCore
|
namespace BlackCore
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,8 +13,8 @@
|
|||||||
#include "contextapplication.h"
|
#include "contextapplication.h"
|
||||||
#include "voicechannel.h"
|
#include "voicechannel.h"
|
||||||
#include "voicevatlib.h"
|
#include "voicevatlib.h"
|
||||||
|
|
||||||
#include "blacksound/soundgenerator.h"
|
#include "blacksound/soundgenerator.h"
|
||||||
|
#include "blackmisc/dbusserver.h"
|
||||||
#include "blackmisc/audio/notificationsounds.h"
|
#include "blackmisc/audio/notificationsounds.h"
|
||||||
#include "blackmisc/audio/voiceroomlist.h"
|
#include "blackmisc/audio/voiceroomlist.h"
|
||||||
#include "blackmisc/logmessage.h"
|
#include "blackmisc/logmessage.h"
|
||||||
@@ -72,6 +72,13 @@ namespace BlackCore
|
|||||||
m_unusedVoiceChannels.push_back(m_channel2);
|
m_unusedVoiceChannels.push_back(m_channel2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CContextAudio *CContextAudio::registerWithDBus(CDBusServer *server)
|
||||||
|
{
|
||||||
|
if (!server || this->m_mode != CCoreFacadeConfig::LocalInDbusServer) { return this; }
|
||||||
|
server->addObject(IContextAudio::ObjectPath(), this);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
CContextAudio::~CContextAudio()
|
CContextAudio::~CContextAudio()
|
||||||
{
|
{
|
||||||
this->leaveAllVoiceRooms();
|
this->leaveAllVoiceRooms();
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
#include "blackcore/actionbind.h"
|
#include "blackcore/actionbind.h"
|
||||||
#include "blackinput/keyboard.h"
|
#include "blackinput/keyboard.h"
|
||||||
#include "blackcore/settings/audio.h"
|
#include "blackcore/settings/audio.h"
|
||||||
#include "blackmisc/dbusserver.h"
|
|
||||||
#include "blackmisc/audio/voiceroomlist.h"
|
#include "blackmisc/audio/voiceroomlist.h"
|
||||||
|
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
@@ -30,6 +29,7 @@
|
|||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
#include <QScopedPointer>
|
#include <QScopedPointer>
|
||||||
|
|
||||||
|
namespace BlackMisc { class CDBusServer; }
|
||||||
namespace BlackCore
|
namespace BlackCore
|
||||||
{
|
{
|
||||||
class IVoiceChannel;
|
class IVoiceChannel;
|
||||||
@@ -44,7 +44,6 @@ namespace BlackCore
|
|||||||
friend class IContextAudio;
|
friend class IContextAudio;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//! Destructor
|
//! Destructor
|
||||||
virtual ~CContextAudio();
|
virtual ~CContextAudio();
|
||||||
|
|
||||||
@@ -122,12 +121,7 @@ namespace BlackCore
|
|||||||
CContextAudio(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime);
|
CContextAudio(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime);
|
||||||
|
|
||||||
//! Register myself in DBus
|
//! Register myself in DBus
|
||||||
CContextAudio *registerWithDBus(BlackMisc::CDBusServer *server)
|
CContextAudio *registerWithDBus(BlackMisc::CDBusServer *server);
|
||||||
{
|
|
||||||
if (!server || this->m_mode != CCoreFacadeConfig::LocalInDbusServer) { return this; }
|
|
||||||
server->addObject(IContextAudio::ObjectPath(), this);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include "contextownaircraftimpl.h"
|
#include "contextownaircraftimpl.h"
|
||||||
#include "contextownaircraftproxy.h"
|
#include "contextownaircraftproxy.h"
|
||||||
#include "contextownaircraftempty.h"
|
#include "contextownaircraftempty.h"
|
||||||
|
#include "blackmisc/dbusserver.h"
|
||||||
|
|
||||||
namespace BlackCore
|
namespace BlackCore
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#include "contextaudio.h"
|
#include "contextaudio.h"
|
||||||
#include "contextapplication.h"
|
#include "contextapplication.h"
|
||||||
#include "corefacade.h"
|
#include "corefacade.h"
|
||||||
|
#include "blackmisc/dbusserver.h"
|
||||||
#include "blackmisc/simplecommandparser.h"
|
#include "blackmisc/simplecommandparser.h"
|
||||||
#include "blackmisc/logmessage.h"
|
#include "blackmisc/logmessage.h"
|
||||||
|
|
||||||
@@ -37,6 +38,13 @@ namespace BlackCore
|
|||||||
this->initOwnAircraft();
|
this->initOwnAircraft();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CContextOwnAircraft *CContextOwnAircraft::registerWithDBus(CDBusServer *server)
|
||||||
|
{
|
||||||
|
if (!server || this->m_mode != CCoreFacadeConfig::LocalInDbusServer) return this;
|
||||||
|
server->addObject(IContextOwnAircraft::ObjectPath(), this);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
CContextOwnAircraft::~CContextOwnAircraft() { }
|
CContextOwnAircraft::~CContextOwnAircraft() { }
|
||||||
|
|
||||||
CSimulatedAircraft CContextOwnAircraft::getOwnAircraft() const
|
CSimulatedAircraft CContextOwnAircraft::getOwnAircraft() const
|
||||||
|
|||||||
@@ -16,14 +16,13 @@
|
|||||||
#include "blackcore/contextownaircraft.h"
|
#include "blackcore/contextownaircraft.h"
|
||||||
#include "blackcore/corefacade.h"
|
#include "blackcore/corefacade.h"
|
||||||
#include "blackcore/settings/network.h"
|
#include "blackcore/settings/network.h"
|
||||||
#include "blackmisc/dbusserver.h"
|
|
||||||
#include "blackmisc/aviation/atcstation.h"
|
#include "blackmisc/aviation/atcstation.h"
|
||||||
#include "blackmisc/simulation/ownaircraftprovider.h"
|
#include "blackmisc/simulation/ownaircraftprovider.h"
|
||||||
#include "blackmisc/identifiable.h"
|
#include "blackmisc/identifiable.h"
|
||||||
|
|
||||||
|
namespace BlackMisc { class CDbusServer; }
|
||||||
namespace BlackCore
|
namespace BlackCore
|
||||||
{
|
{
|
||||||
|
|
||||||
//! Own aircraft context implementation.
|
//! Own aircraft context implementation.
|
||||||
//! Central instance of data for \sa IOwnAircraftProvider .
|
//! Central instance of data for \sa IOwnAircraftProvider .
|
||||||
class BLACKCORE_EXPORT CContextOwnAircraft :
|
class BLACKCORE_EXPORT CContextOwnAircraft :
|
||||||
@@ -122,12 +121,7 @@ namespace BlackCore
|
|||||||
CContextOwnAircraft(CCoreFacadeConfig::ContextMode, CCoreFacade *runtime);
|
CContextOwnAircraft(CCoreFacadeConfig::ContextMode, CCoreFacade *runtime);
|
||||||
|
|
||||||
//! Register myself in DBus
|
//! Register myself in DBus
|
||||||
CContextOwnAircraft *registerWithDBus(BlackMisc::CDBusServer *server)
|
CContextOwnAircraft *registerWithDBus(BlackMisc::CDBusServer *server);
|
||||||
{
|
|
||||||
if (!server || this->m_mode != CCoreFacadeConfig::LocalInDbusServer) return this;
|
|
||||||
server->addObject(IContextOwnAircraft::ObjectPath(), this);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
//! Station has been changed, needed to tune in/out voice room
|
//! Station has been changed, needed to tune in/out voice room
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include "contextsimulatorimpl.h"
|
#include "contextsimulatorimpl.h"
|
||||||
#include "contextsimulatorproxy.h"
|
#include "contextsimulatorproxy.h"
|
||||||
#include "contextsimulatorempty.h"
|
#include "contextsimulatorempty.h"
|
||||||
|
#include "blackmisc/dbusserver.h"
|
||||||
|
|
||||||
using namespace BlackMisc::PhysicalQuantities;
|
using namespace BlackMisc::PhysicalQuantities;
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,6 @@
|
|||||||
#include "context.h"
|
#include "context.h"
|
||||||
#include "blackcore/simulator.h"
|
#include "blackcore/simulator.h"
|
||||||
#include "blackcore/corefacade.h"
|
#include "blackcore/corefacade.h"
|
||||||
#include "blackmisc/dbusserver.h"
|
|
||||||
#include "blackmisc/simulation/aircraftmodellist.h"
|
#include "blackmisc/simulation/aircraftmodellist.h"
|
||||||
#include "blackmisc/simulation/simulatorplugininfo.h"
|
#include "blackmisc/simulation/simulatorplugininfo.h"
|
||||||
#include "blackmisc/simulation/simulatorsetup.h"
|
#include "blackmisc/simulation/simulatorsetup.h"
|
||||||
@@ -39,6 +38,7 @@
|
|||||||
#include "blackmisc/pq/time.h"
|
#include "blackmisc/pq/time.h"
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
|
namespace BlackMisc { class CDBusServer; }
|
||||||
namespace BlackCore
|
namespace BlackCore
|
||||||
{
|
{
|
||||||
//! Network context
|
//! Network context
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
#include "pluginmanagersimulator.h"
|
#include "pluginmanagersimulator.h"
|
||||||
#include "corefacade.h"
|
#include "corefacade.h"
|
||||||
#include "blackcore/registermetadata.h"
|
#include "blackcore/registermetadata.h"
|
||||||
|
#include "blackmisc/dbusserver.h"
|
||||||
#include "blackmisc/propertyindexvariantmap.h"
|
#include "blackmisc/propertyindexvariantmap.h"
|
||||||
#include "blackmisc/logmessage.h"
|
#include "blackmisc/logmessage.h"
|
||||||
#include "blackmisc/loghandler.h"
|
#include "blackmisc/loghandler.h"
|
||||||
@@ -40,6 +41,13 @@ namespace BlackCore
|
|||||||
m_plugins->collectPlugins();
|
m_plugins->collectPlugins();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CContextSimulator *CContextSimulator::registerWithDBus(CDBusServer *server)
|
||||||
|
{
|
||||||
|
if (!server || this->m_mode != CCoreFacadeConfig::LocalInDbusServer) return this;
|
||||||
|
server->addObject(CContextSimulator::ObjectPath(), this);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
CContextSimulator::~CContextSimulator()
|
CContextSimulator::~CContextSimulator()
|
||||||
{
|
{
|
||||||
this->gracefulShutdown();
|
this->gracefulShutdown();
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
||||||
|
namespace BlackMisc { class CDBusServer; }
|
||||||
namespace BlackCore
|
namespace BlackCore
|
||||||
{
|
{
|
||||||
class CPluginManagerSimulator;
|
class CPluginManagerSimulator;
|
||||||
@@ -128,12 +129,7 @@ namespace BlackCore
|
|||||||
CContextSimulator(CCoreFacadeConfig::ContextMode, CCoreFacade *runtime);
|
CContextSimulator(CCoreFacadeConfig::ContextMode, CCoreFacade *runtime);
|
||||||
|
|
||||||
//! Register myself in DBus
|
//! Register myself in DBus
|
||||||
CContextSimulator *registerWithDBus(BlackMisc::CDBusServer *server)
|
CContextSimulator *registerWithDBus(BlackMisc::CDBusServer *server);
|
||||||
{
|
|
||||||
if (!server || this->m_mode != CCoreFacadeConfig::LocalInDbusServer) return this;
|
|
||||||
server->addObject(CContextSimulator::ObjectPath(), this);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
//! Remote aircraft added
|
//! Remote aircraft added
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ using namespace BlackMisc::Network;
|
|||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
{
|
{
|
||||||
|
|
||||||
CDBusServer::CDBusServer(const QString &service, const QString &address, QObject *parent) : QObject(parent)
|
CDBusServer::CDBusServer(const QString &service, const QString &address, QObject *parent) : QObject(parent)
|
||||||
{
|
{
|
||||||
m_serverMode = modeOfAddress(address);
|
m_serverMode = modeOfAddress(address);
|
||||||
@@ -248,6 +247,7 @@ namespace BlackMisc
|
|||||||
|
|
||||||
void CDBusServer::removeAllObjects()
|
void CDBusServer::removeAllObjects()
|
||||||
{
|
{
|
||||||
|
if (m_objects.isEmpty()) { return; }
|
||||||
for (const QString &path : m_objects.keys())
|
for (const QString &path : m_objects.keys())
|
||||||
{
|
{
|
||||||
switch (m_serverMode)
|
switch (m_serverMode)
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
{
|
{
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Custom DBusServer
|
* Custom DBusServer
|
||||||
* \details This class implements a custom DBusServer for DBus peer connections, but can also be used
|
* \details This class implements a custom DBusServer for DBus peer connections, but can also be used
|
||||||
|
|||||||
Reference in New Issue
Block a user