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