refs #520 Moved CDBusServer from BlackCore to BlackMisc.

This commit is contained in:
Mathew Sutcliffe
2015-11-28 02:25:56 +00:00
parent d35fc3f056
commit fbcc42424d
38 changed files with 70 additions and 70 deletions

View File

@@ -9,7 +9,7 @@
#include "blackmisc/registermetadata.h" #include "blackmisc/registermetadata.h"
#include "servicetool.h" #include "servicetool.h"
#include "blackcore/dbusserver.h" #include "blackmisc/dbusserver.h"
#include <QDBusMetaType> #include <QDBusMetaType>
#include <QtDBus/qdbusabstractinterface.h> #include <QtDBus/qdbusabstractinterface.h>
#include <QtDBus/qdbusconnection.h> #include <QtDBus/qdbusconnection.h>
@@ -122,7 +122,7 @@ int main(int argc, char *argv[])
qDebug(); qDebug();
qDebug("--------------------------------------------------------"); qDebug("--------------------------------------------------------");
BlackCore::CDBusServer *dBusServer = new BlackCore::CDBusServer(useSessionBusForServer ? "session" : address); BlackMisc::CDBusServer *dBusServer = new BlackMisc::CDBusServer(useSessionBusForServer ? "session" : address);
if (dBusServer->hasQDBusServer()) if (dBusServer->hasQDBusServer())
{ {
qDebug() << "server" << dBusServer->qDBusServer()->address() << "connected:" << dBusServer->qDBusServer()->isConnected(); qDebug() << "server" << dBusServer->qDBusServer()->address() << "connected:" << dBusServer->qDBusServer()->isConnected();

View File

@@ -10,7 +10,7 @@
#include "servicetool.h" #include "servicetool.h"
#include "testservice.h" #include "testservice.h"
#include "testserviceinterface.h" #include "testserviceinterface.h"
#include "blackcore/dbusserver.h" #include "blackmisc/dbusserver.h"
#include <QTextStream> #include <QTextStream>
#include <QString> #include <QString>
@@ -59,7 +59,7 @@ namespace BlackMiscTest
arg.endArray(); arg.endArray();
} }
void ServiceTool::dataTransferTestServer(BlackCore::CDBusServer *dBusServer) void ServiceTool::dataTransferTestServer(BlackMisc::CDBusServer *dBusServer)
{ {
QDBusConnection sessionBusConnection = QDBusConnection::sessionBus(); QDBusConnection sessionBusConnection = QDBusConnection::sessionBus();
if (sessionBusConnection.interface()->isServiceRegistered(Testservice::ServiceName)) if (sessionBusConnection.interface()->isServiceRegistered(Testservice::ServiceName))

View File

@@ -12,7 +12,7 @@
#ifndef BLACKMISCTEST_SERVICETOOL_H #ifndef BLACKMISCTEST_SERVICETOOL_H
#define BLACKMISCTEST_SERVICETOOL_H #define BLACKMISCTEST_SERVICETOOL_H
#include "blackcore/dbusserver.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"
@@ -52,7 +52,7 @@ namespace BlackMiscTest
/*! /*!
* \brief Server side of data transfer test * \brief Server side of data transfer test
*/ */
static void dataTransferTestServer(BlackCore::CDBusServer *dBusServer); static void dataTransferTestServer(BlackMisc::CDBusServer *dBusServer);
/*! /*!
* \brief Start a new process * \brief Start a new process

View File

@@ -25,7 +25,7 @@ using namespace BlackMisc;
namespace BlackCore namespace BlackCore
{ {
IContextApplication *IContextApplication::create(CRuntime *parent, CRuntimeConfig::ContextMode mode, CDBusServer *server, QDBusConnection &connection) IContextApplication *IContextApplication::create(CRuntime *parent, CRuntimeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &connection)
{ {
switch (mode) switch (mode)
{ {
@@ -33,7 +33,7 @@ namespace BlackCore
case CRuntimeConfig::LocalInDbusServer: case CRuntimeConfig::LocalInDbusServer:
return (new CContextApplication(mode, parent))->registerWithDBus(server); return (new CContextApplication(mode, parent))->registerWithDBus(server);
case CRuntimeConfig::Remote: case CRuntimeConfig::Remote:
return new BlackCore::CContextApplicationProxy(BlackCore::CDBusServer::ServiceName(), connection, mode, parent); return new BlackCore::CContextApplicationProxy(BlackMisc::CDBusServer::ServiceName(), connection, mode, parent);
case CRuntimeConfig::NotUsed: case CRuntimeConfig::NotUsed:
default: default:
return new CContextApplicationEmpty(parent); return new CContextApplicationEmpty(parent);

View File

@@ -72,7 +72,7 @@ namespace BlackCore
virtual QString getPathAndContextId() const { return this->buildPathAndContextId(ObjectPath()); } virtual QString getPathAndContextId() const { return this->buildPathAndContextId(ObjectPath()); }
//! Factory method //! Factory method
static IContextApplication *create(CRuntime *parent, CRuntimeConfig::ContextMode mode, CDBusServer *server, QDBusConnection &conn); static IContextApplication *create(CRuntime *parent, CRuntimeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &conn);
//! Destructor //! Destructor
virtual ~IContextApplication() {} virtual ~IContextApplication() {}

View File

@@ -24,7 +24,7 @@ namespace BlackCore
IContextApplication(mode, runtime) IContextApplication(mode, runtime)
{} {}
CContextApplication *CContextApplication::registerWithDBus(CDBusServer *server) CContextApplication *CContextApplication::registerWithDBus(BlackMisc::CDBusServer *server)
{ {
if (!server || this->m_mode != CRuntimeConfig::LocalInDbusServer) { return this; } if (!server || this->m_mode != CRuntimeConfig::LocalInDbusServer) { return this; }
server->addObject(IContextApplication::ObjectPath(), this); server->addObject(IContextApplication::ObjectPath(), this);

View File

@@ -13,7 +13,7 @@
#include "blackcoreexport.h" #include "blackcoreexport.h"
#include "contextapplication.h" #include "contextapplication.h"
#include "contextruntime.h" #include "contextruntime.h"
#include "dbusserver.h" #include "blackmisc/dbusserver.h"
#include "blackmisc/identifierlist.h" #include "blackmisc/identifierlist.h"
namespace BlackCore namespace BlackCore
@@ -95,7 +95,7 @@ namespace BlackCore
CContextApplication(CRuntimeConfig::ContextMode mode, CRuntime *runtime); CContextApplication(CRuntimeConfig::ContextMode mode, CRuntime *runtime);
//! Register myself in DBus, fail safe //! Register myself in DBus, fail safe
CContextApplication *registerWithDBus(CDBusServer *server); CContextApplication *registerWithDBus(BlackMisc::CDBusServer *server);
private: private:
BlackMisc::CIdentifierList m_registeredApplications; BlackMisc::CIdentifierList m_registeredApplications;

View File

@@ -15,7 +15,7 @@
namespace BlackCore namespace BlackCore
{ {
IContextAudio *IContextAudio::create(CRuntime *runtime, CRuntimeConfig::ContextMode mode, CDBusServer *server, QDBusConnection &conn) IContextAudio *IContextAudio::create(CRuntime *runtime, CRuntimeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &conn)
{ {
switch (mode) switch (mode)
{ {
@@ -23,7 +23,7 @@ namespace BlackCore
case CRuntimeConfig::LocalInDbusServer: case CRuntimeConfig::LocalInDbusServer:
return (new CContextAudio(mode, runtime))->registerWithDBus(server); return (new CContextAudio(mode, runtime))->registerWithDBus(server);
case CRuntimeConfig::Remote: case CRuntimeConfig::Remote:
return new CContextAudioProxy(BlackCore::CDBusServer::ServiceName(), conn, mode, runtime); return new CContextAudioProxy(BlackMisc::CDBusServer::ServiceName(), conn, mode, runtime);
default: default:
return new CContextAudioEmpty(runtime); // audio not mandatory return new CContextAudioEmpty(runtime); // audio not mandatory
} }

View File

@@ -67,7 +67,7 @@ namespace BlackCore
virtual QString getPathAndContextId() const { return this->buildPathAndContextId(ObjectPath()); } virtual QString getPathAndContextId() const { return this->buildPathAndContextId(ObjectPath()); }
//! Factory method //! Factory method
static IContextAudio *create(CRuntime *runtime, CRuntimeConfig::ContextMode mode, CDBusServer *server, QDBusConnection &conn); static IContextAudio *create(CRuntime *runtime, CRuntimeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &conn);
//! Destructor //! Destructor
virtual ~IContextAudio() {} virtual ~IContextAudio() {}

View File

@@ -14,8 +14,8 @@
#include "blackcoreexport.h" #include "blackcoreexport.h"
#include "contextaudio.h" #include "contextaudio.h"
#include "dbusserver.h"
#include "voice.h" #include "voice.h"
#include "blackmisc/dbusserver.h"
namespace BlackCore namespace BlackCore
{ {

View File

@@ -15,7 +15,6 @@
#include "blackcore/blackcoreexport.h" #include "blackcore/blackcoreexport.h"
#include "blackcore/contextaudio.h" #include "blackcore/contextaudio.h"
#include "blackcore/contextruntime.h" #include "blackcore/contextruntime.h"
#include "blackcore/dbusserver.h"
#include "blackcore/voice.h" #include "blackcore/voice.h"
#include "blackcore/voicechannel.h" #include "blackcore/voicechannel.h"
#include "blackcore/audiodevice.h" #include "blackcore/audiodevice.h"
@@ -23,6 +22,7 @@
#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>
@@ -122,7 +122,7 @@ namespace BlackCore
CContextAudio(CRuntimeConfig::ContextMode mode, CRuntime *runtime); CContextAudio(CRuntimeConfig::ContextMode mode, CRuntime *runtime);
//! Register myself in DBus //! Register myself in DBus
CContextAudio *registerWithDBus(CDBusServer *server) CContextAudio *registerWithDBus(BlackMisc::CDBusServer *server)
{ {
if (!server || this->m_mode != CRuntimeConfig::LocalInDbusServer) { return this; } if (!server || this->m_mode != CRuntimeConfig::LocalInDbusServer) { return this; }
server->addObject(IContextAudio::ObjectPath(), this); server->addObject(IContextAudio::ObjectPath(), this);

View File

@@ -15,7 +15,7 @@
namespace BlackCore namespace BlackCore
{ {
IContextNetwork *IContextNetwork::create(CRuntime *runtime, CRuntimeConfig::ContextMode mode, CDBusServer *server, QDBusConnection &connection) IContextNetwork *IContextNetwork::create(CRuntime *runtime, CRuntimeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &connection)
{ {
switch (mode) switch (mode)
{ {
@@ -23,7 +23,7 @@ namespace BlackCore
case CRuntimeConfig::LocalInDbusServer: case CRuntimeConfig::LocalInDbusServer:
return (new CContextNetwork(mode, runtime))->registerWithDBus(server); return (new CContextNetwork(mode, runtime))->registerWithDBus(server);
case CRuntimeConfig::Remote: case CRuntimeConfig::Remote:
return new CContextNetworkProxy(BlackCore::CDBusServer::ServiceName(), connection, mode, runtime); return new CContextNetworkProxy(BlackMisc::CDBusServer::ServiceName(), connection, mode, runtime);
case CRuntimeConfig::NotUsed: case CRuntimeConfig::NotUsed:
default: default:
return new CContextNetworkEmpty(runtime); return new CContextNetworkEmpty(runtime);

View File

@@ -65,7 +65,7 @@ namespace BlackCore
virtual QString getPathAndContextId() const { return this->buildPathAndContextId(ObjectPath()); } virtual QString getPathAndContextId() const { return this->buildPathAndContextId(ObjectPath()); }
//! Factory method //! Factory method
static IContextNetwork *create(CRuntime *parent, CRuntimeConfig::ContextMode mode, CDBusServer *server, QDBusConnection &connection); static IContextNetwork *create(CRuntime *parent, CRuntimeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &connection);
//! Destructor //! Destructor
virtual ~IContextNetwork() {} virtual ~IContextNetwork() {}

View File

@@ -78,7 +78,7 @@ namespace BlackCore
connect(this->m_airspace, &CAirspaceMonitor::addedAircraft, this, &CContextNetwork::addedAircraft); connect(this->m_airspace, &CAirspaceMonitor::addedAircraft, this, &CContextNetwork::addedAircraft);
} }
CContextNetwork *CContextNetwork::registerWithDBus(CDBusServer *server) CContextNetwork *CContextNetwork::registerWithDBus(BlackMisc::CDBusServer *server)
{ {
if (!server || this->m_mode != CRuntimeConfig::LocalInDbusServer) return this; if (!server || this->m_mode != CRuntimeConfig::LocalInDbusServer) return this;
server->addObject(IContextNetwork::ObjectPath(), this); server->addObject(IContextNetwork::ObjectPath(), this);

View File

@@ -15,8 +15,8 @@
#include "blackcoreexport.h" #include "blackcoreexport.h"
#include "blackcore/contextnetwork.h" #include "blackcore/contextnetwork.h"
#include "blackcore/contextruntime.h" #include "blackcore/contextruntime.h"
#include "blackcore/dbusserver.h"
#include "blackcore/network.h" #include "blackcore/network.h"
#include "blackmisc/dbusserver.h"
#include "blackmisc/simulation/remoteaircraftprovider.h" #include "blackmisc/simulation/remoteaircraftprovider.h"
#include "blackmisc/aviation/atcstationlist.h" #include "blackmisc/aviation/atcstationlist.h"
#include "blackmisc/aviation/aircraftsituationlist.h" #include "blackmisc/aviation/aircraftsituationlist.h"
@@ -233,7 +233,7 @@ namespace BlackCore
CContextNetwork(CRuntimeConfig::ContextMode, CRuntime *runtime); CContextNetwork(CRuntimeConfig::ContextMode, CRuntime *runtime);
//! Register myself in DBus //! Register myself in DBus
CContextNetwork *registerWithDBus(CDBusServer *server); CContextNetwork *registerWithDBus(BlackMisc::CDBusServer *server);
private: private:
CAirspaceMonitor *m_airspace = nullptr; CAirspaceMonitor *m_airspace = nullptr;

View File

@@ -14,7 +14,7 @@
namespace BlackCore namespace BlackCore
{ {
IContextOwnAircraft *IContextOwnAircraft::create(CRuntime *parent, CRuntimeConfig::ContextMode mode, CDBusServer *server, QDBusConnection &conn) IContextOwnAircraft *IContextOwnAircraft::create(CRuntime *parent, CRuntimeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &conn)
{ {
switch (mode) switch (mode)
{ {
@@ -22,7 +22,7 @@ namespace BlackCore
case CRuntimeConfig::LocalInDbusServer: case CRuntimeConfig::LocalInDbusServer:
return (new CContextOwnAircraft(mode, parent))->registerWithDBus(server); return (new CContextOwnAircraft(mode, parent))->registerWithDBus(server);
case CRuntimeConfig::Remote: case CRuntimeConfig::Remote:
return new CContextOwnAircraftProxy(BlackCore::CDBusServer::ServiceName(), conn, mode, parent); return new CContextOwnAircraftProxy(BlackMisc::CDBusServer::ServiceName(), conn, mode, parent);
case CRuntimeConfig::NotUsed: case CRuntimeConfig::NotUsed:
default: default:
return new CContextOwnAircraftEmpty(parent); return new CContextOwnAircraftEmpty(parent);

View File

@@ -59,7 +59,7 @@ namespace BlackCore
virtual QString getPathAndContextId() const { return this->buildPathAndContextId(ObjectPath()); } virtual QString getPathAndContextId() const { return this->buildPathAndContextId(ObjectPath()); }
//! Factory method //! Factory method
static IContextOwnAircraft *create(CRuntime *parent, CRuntimeConfig::ContextMode mode, CDBusServer *server, QDBusConnection &conn); static IContextOwnAircraft *create(CRuntime *parent, CRuntimeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &conn);
//! Destructor //! Destructor
virtual ~IContextOwnAircraft() {} virtual ~IContextOwnAircraft() {}

View File

@@ -15,8 +15,8 @@
#include "blackcoreexport.h" #include "blackcoreexport.h"
#include "blackcore/contextownaircraft.h" #include "blackcore/contextownaircraft.h"
#include "blackcore/contextruntime.h" #include "blackcore/contextruntime.h"
#include "blackcore/dbusserver.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"
@@ -123,7 +123,7 @@ namespace BlackCore
CContextOwnAircraft(CRuntimeConfig::ContextMode, CRuntime *runtime); CContextOwnAircraft(CRuntimeConfig::ContextMode, CRuntime *runtime);
//! Register myself in DBus //! Register myself in DBus
CContextOwnAircraft *registerWithDBus(CDBusServer *server) CContextOwnAircraft *registerWithDBus(BlackMisc::CDBusServer *server)
{ {
if (!server || this->m_mode != CRuntimeConfig::LocalInDbusServer) return this; if (!server || this->m_mode != CRuntimeConfig::LocalInDbusServer) return this;
server->addObject(IContextOwnAircraft::ObjectPath(), this); server->addObject(IContextOwnAircraft::ObjectPath(), this);

View File

@@ -24,11 +24,12 @@
#include <QMultiMap> #include <QMultiMap>
#include <QReadWriteLock> #include <QReadWriteLock>
namespace BlackMisc { class CDBusServer; }
namespace BlackCore namespace BlackCore
{ {
// forward declaration, see review // forward declaration, see review
// https://dev.vatsim-germany.org/boards/22/topics/1350?r=1359#message-1359 // https://dev.vatsim-germany.org/boards/22/topics/1350?r=1359#message-1359
class CDBusServer;
class CContextApplication; class CContextApplication;
class CContextAudio; class CContextAudio;
class CContextNetwork; class CContextNetwork;
@@ -53,7 +54,7 @@ namespace BlackCore
virtual ~CRuntime() { this->gracefulShutdown(); } virtual ~CRuntime() { this->gracefulShutdown(); }
//! DBus server (if applicable) //! DBus server (if applicable)
const CDBusServer *getDBusServer() const { return this->m_dbusServer; } const BlackMisc::CDBusServer *getDBusServer() const { return this->m_dbusServer; }
//! DBus connection (if applicable) //! DBus connection (if applicable)
const QDBusConnection &getDBusConnection() const { return this->m_dbusConnection; } const QDBusConnection &getDBusConnection() const { return this->m_dbusConnection; }
@@ -153,7 +154,7 @@ namespace BlackCore
CSetting<Settings::Network::DBusServerAddress> m_dbusServerAddress { this }; CSetting<Settings::Network::DBusServerAddress> m_dbusServerAddress { this };
// DBus // DBus
CDBusServer *m_dbusServer = nullptr; BlackMisc::CDBusServer *m_dbusServer = nullptr;
QDBusConnection m_dbusConnection = QDBusConnection("default"); QDBusConnection m_dbusConnection = QDBusConnection("default");
bool m_initDBusConnection = false; bool m_initDBusConnection = false;

View File

@@ -34,7 +34,7 @@ namespace BlackCore
return t; return t;
} }
IContextSimulator *IContextSimulator::create(CRuntime *parent, CRuntimeConfig::ContextMode mode, CDBusServer *server, QDBusConnection &conn) IContextSimulator *IContextSimulator::create(CRuntime *parent, CRuntimeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &conn)
{ {
switch (mode) switch (mode)
{ {
@@ -42,7 +42,7 @@ namespace BlackCore
case CRuntimeConfig::LocalInDbusServer: case CRuntimeConfig::LocalInDbusServer:
return (new CContextSimulator(mode, parent))->registerWithDBus(server); return (new CContextSimulator(mode, parent))->registerWithDBus(server);
case CRuntimeConfig::Remote: case CRuntimeConfig::Remote:
return new CContextSimulatorProxy(BlackCore::CDBusServer::ServiceName(), conn, mode, parent); return new CContextSimulatorProxy(BlackMisc::CDBusServer::ServiceName(), conn, mode, parent);
case CRuntimeConfig::NotUsed: case CRuntimeConfig::NotUsed:
default: default:
return new CContextSimulatorEmpty(parent); return new CContextSimulatorEmpty(parent);

View File

@@ -26,8 +26,8 @@
#include "blackcoreexport.h" #include "blackcoreexport.h"
#include "context.h" #include "context.h"
#include "blackcore/simulator.h" #include "blackcore/simulator.h"
#include "blackcore/dbusserver.h"
#include "blackcore/contextruntime.h" #include "blackcore/contextruntime.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"
@@ -61,7 +61,7 @@ namespace BlackCore
virtual QString getPathAndContextId() const { return this->buildPathAndContextId(ObjectPath()); } virtual QString getPathAndContextId() const { return this->buildPathAndContextId(ObjectPath()); }
//! Factory method //! Factory method
static IContextSimulator *create(CRuntime *parent, CRuntimeConfig::ContextMode mode, CDBusServer *server, QDBusConnection &conn); static IContextSimulator *create(CRuntime *parent, CRuntimeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &conn);
//! Destructor //! Destructor
virtual ~IContextSimulator() {} virtual ~IContextSimulator() {}

View File

@@ -128,7 +128,7 @@ namespace BlackCore
CContextSimulator(CRuntimeConfig::ContextMode, CRuntime *runtime); CContextSimulator(CRuntimeConfig::ContextMode, CRuntime *runtime);
//! Register myself in DBus //! Register myself in DBus
CContextSimulator *registerWithDBus(CDBusServer *server) CContextSimulator *registerWithDBus(BlackMisc::CDBusServer *server)
{ {
if (!server || this->m_mode != CRuntimeConfig::LocalInDbusServer) return this; if (!server || this->m_mode != CRuntimeConfig::LocalInDbusServer) return this;
server->addObject(CContextSimulator::ObjectPath(), this); server->addObject(CContextSimulator::ObjectPath(), this);

View File

@@ -11,9 +11,9 @@
#include "ui_settingscomponent.h" #include "ui_settingscomponent.h"
#include "blackgui/models/atcstationlistmodel.h" #include "blackgui/models/atcstationlistmodel.h"
#include "blackgui/stylesheetutility.h" #include "blackgui/stylesheetutility.h"
#include "blackcore/dbusserver.h"
#include "blackcore/contextnetwork.h" #include "blackcore/contextnetwork.h"
#include "blackcore/contextaudio.h" #include "blackcore/contextaudio.h"
#include "blackmisc/dbusserver.h"
#include "blackmisc/input/keyboardkeylist.h" #include "blackmisc/input/keyboardkeylist.h"
#include "blackmisc/logmessage.h" #include "blackmisc/logmessage.h"
#include <QColorDialog> #include <QColorDialog>

View File

@@ -7,16 +7,15 @@
* contained in the LICENSE file. * contained in the LICENSE file.
*/ */
#include "dbusserver.h"
#include "blackmisc/logmessage.h" #include "blackmisc/logmessage.h"
#include "blackmisc/network/networkutils.h" #include "blackmisc/network/networkutils.h"
#include "dbusserver.h"
#include <QProcess> #include <QProcess>
#include <QMetaClassInfo> #include <QMetaClassInfo>
using namespace BlackMisc;
using namespace BlackMisc::Network; using namespace BlackMisc::Network;
namespace BlackCore namespace BlackMisc
{ {
/* /*
* Constructor * Constructor
@@ -98,7 +97,7 @@ namespace BlackCore
const QString &CDBusServer::ServiceName() const QString &CDBusServer::ServiceName()
{ {
static const QString sn(BLACKCORE_RUNTIME_SERVICENAME); static const QString sn(SWIFT_SERVICENAME);
return sn; return sn;
} }

View File

@@ -9,10 +9,10 @@
//! \file //! \file
#ifndef BLACKCORE_DBUSSERVER_H #ifndef BLACKMISC_DBUSSERVER_H
#define BLACKCORE_DBUSSERVER_H #define BLACKMISC_DBUSSERVER_H
#include "blackcoreexport.h" #include "blackmiscexport.h"
#include "blackmisc/valueobject.h" // for qHash overload, include before Qt stuff due GCC issue #include "blackmisc/valueobject.h" // for qHash overload, include before Qt stuff due GCC issue
#include <QObject> #include <QObject>
#include <QtDBus/QDBusServer> #include <QtDBus/QDBusServer>
@@ -22,9 +22,9 @@
#include <QMap> #include <QMap>
//! Service name of DBus service //! Service name of DBus service
#define BLACKCORE_RUNTIME_SERVICENAME "org.swift-project" #define SWIFT_SERVICENAME "org.swift-project"
namespace BlackCore namespace BlackMisc
{ {
/*! /*!
@@ -33,10 +33,10 @@ namespace BlackCore
* with session or system bus. For session / system bus this class represents no real server, * with session or system bus. For session / system bus this class represents no real server,
* but more a wrapper for \sa QDBusConnection and the registered objects * but more a wrapper for \sa QDBusConnection and the registered objects
*/ */
class BLACKCORE_EXPORT CDBusServer : public QObject class BLACKMISC_EXPORT CDBusServer : public QObject
{ {
Q_OBJECT Q_OBJECT
Q_CLASSINFO("D-Bus Interface", BLACKCORE_RUNTIME_SERVICENAME) Q_CLASSINFO("D-Bus Interface", SWIFT_SERVICENAME)
public: public:
//! Service name of DBus server //! Service name of DBus server

View File

@@ -11,7 +11,7 @@
#include "xbusserviceproxy.h" #include "xbusserviceproxy.h"
#include "xbustrafficproxy.h" #include "xbustrafficproxy.h"
#include "xbusweatherproxy.h" #include "xbusweatherproxy.h"
#include "blackcore/dbusserver.h" #include "blackmisc/dbusserver.h"
#include "blackmisc/logmessage.h" #include "blackmisc/logmessage.h"
#include "blackmisc/blackmiscfreefunctions.h" #include "blackmisc/blackmiscfreefunctions.h"
#include "blackmisc/simulation/modelmappingsprovider.h" #include "blackmisc/simulation/modelmappingsprovider.h"
@@ -354,11 +354,11 @@ namespace BlackSimPlugin
QDBusConnection CSimulatorXPlane::connectionFromString(const QString &str) QDBusConnection CSimulatorXPlane::connectionFromString(const QString &str)
{ {
if (str == BlackCore::CDBusServer::sessionDBusServer()) if (str == BlackMisc::CDBusServer::sessionDBusServer())
{ {
return QDBusConnection::sessionBus(); return QDBusConnection::sessionBus();
} }
else if (str == BlackCore::CDBusServer::systemDBusServer()) else if (str == BlackMisc::CDBusServer::systemDBusServer())
{ {
return QDBusConnection::systemBus(); return QDBusConnection::systemBus();
} }

View File

@@ -4,7 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "xbusserviceproxy.h" #include "xbusserviceproxy.h"
#include "blackcore/dbusserver.h" #include "blackmisc/dbusserver.h"
#include <QMetaMethod> #include <QMetaMethod>
#define XBUS_SERVICE_SERVICENAME "org.swift-project.xbus" #define XBUS_SERVICE_SERVICENAME "org.swift-project.xbus"

View File

@@ -4,7 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "xbustrafficproxy.h" #include "xbustrafficproxy.h"
#include "blackcore/dbusserver.h" #include "blackmisc/dbusserver.h"
#include <QMetaMethod> #include <QMetaMethod>
#define XBUS_SERVICENAME "org.swift-project.xbus" #define XBUS_SERVICENAME "org.swift-project.xbus"

View File

@@ -8,7 +8,7 @@
*/ */
#include "xbusweatherproxy.h" #include "xbusweatherproxy.h"
#include "blackcore/dbusserver.h" #include "blackmisc/dbusserver.h"
#define XBUS_SERVICENAME "org.swift-project.xbus" #define XBUS_SERVICENAME "org.swift-project.xbus"

View File

@@ -1,6 +1,6 @@
#include "simulatorxplaneconfigwindow.h" #include "simulatorxplaneconfigwindow.h"
#include "ui_simulatorxplaneconfigwindow.h" #include "ui_simulatorxplaneconfigwindow.h"
#include "blackcore/dbusserver.h" #include "blackmisc/dbusserver.h"
#include "blackmisc/simulation/xplane/xplaneutil.h" #include "blackmisc/simulation/xplane/xplaneutil.h"
#include "blackmisc/fileutils.h" #include "blackmisc/fileutils.h"
#include <QStringBuilder> #include <QStringBuilder>
@@ -30,8 +30,8 @@ namespace BlackSimPlugin
{ {
ui->setupUi(this); ui->setupUi(this);
ui->cp_XBusServer->addItem(BlackCore::CDBusServer::sessionDBusServer()); ui->cp_XBusServer->addItem(BlackMisc::CDBusServer::sessionDBusServer());
ui->cp_XBusServer->addItem(BlackCore::CDBusServer::systemDBusServer()); ui->cp_XBusServer->addItem(BlackMisc::CDBusServer::systemDBusServer());
connect(ui->bb_OkCancel, &QDialogButtonBox::accepted, this, &CSimulatorXPlaneConfigWindow::ps_storeSettings); connect(ui->bb_OkCancel, &QDialogButtonBox::accepted, this, &CSimulatorXPlaneConfigWindow::ps_storeSettings);
connect(ui->bb_OkCancel, &QDialogButtonBox::accepted, this, &CSimulatorXPlaneConfigWindow::close); connect(ui->bb_OkCancel, &QDialogButtonBox::accepted, this, &CSimulatorXPlaneConfigWindow::close);

View File

@@ -11,7 +11,7 @@
#include "blackcore/contextruntime.h" #include "blackcore/contextruntime.h"
#include "blackcore/contextapplication.h" #include "blackcore/contextapplication.h"
#include "blackcore/contextapplicationimpl.h" #include "blackcore/contextapplicationimpl.h"
#include "blackcore/dbusserver.h" #include "blackmisc/dbusserver.h"
#include "blackmisc/icons.h" #include "blackmisc/icons.h"
#include "blackmisc/worker.h" #include "blackmisc/worker.h"
#include "blackmisc/network/networkutils.h" #include "blackmisc/network/networkutils.h"

View File

@@ -12,9 +12,9 @@
#include "blackmisc/icon.h" #include "blackmisc/icon.h"
#include "blackmisc/loghandler.h" #include "blackmisc/loghandler.h"
#include "blackmisc/project.h" #include "blackmisc/project.h"
#include "blackmisc/dbusserver.h"
#include "blackgui/components/logcomponent.h" #include "blackgui/components/logcomponent.h"
#include "blackgui/components/enableforruntime.h" #include "blackgui/components/enableforruntime.h"
#include "blackcore/dbusserver.h"
#include "blackgui/stylesheetutility.h" #include "blackgui/stylesheetutility.h"
#include <QMenu> #include <QMenu>
#include <QMessageBox> #include <QMessageBox>

View File

@@ -14,11 +14,11 @@
#include "blackgui/models/atcstationlistmodel.h" #include "blackgui/models/atcstationlistmodel.h"
#include "blackgui/components/logcomponent.h" #include "blackgui/components/logcomponent.h"
#include "blackgui/components/settingscomponent.h" #include "blackgui/components/settingscomponent.h"
#include "blackcore/dbusserver.h"
#include "blackcore/contextnetwork.h" #include "blackcore/contextnetwork.h"
#include "blackcore/contextapplication.h" #include "blackcore/contextapplication.h"
#include "blackcore/contextownaircraft.h" #include "blackcore/contextownaircraft.h"
#include "blackcore/network.h" #include "blackcore/network.h"
#include "blackmisc/dbusserver.h"
#include "blackmisc/logmessage.h" #include "blackmisc/logmessage.h"
#include "blackmisc/audio/notificationsounds.h" #include "blackmisc/audio/notificationsounds.h"
#include <QMouseEvent> #include <QMouseEvent>

View File

@@ -9,7 +9,7 @@
#include "swiftguistd.h" #include "swiftguistd.h"
#include "blackgui/models/atcstationlistmodel.h" #include "blackgui/models/atcstationlistmodel.h"
#include "blackcore/dbusserver.h" #include "blackmisc/dbusserver.h"
#include "blackcore/contextnetwork.h" #include "blackcore/contextnetwork.h"
using namespace BlackCore; using namespace BlackCore;

View File

@@ -9,12 +9,12 @@
#include "swiftguistd.h" #include "swiftguistd.h"
#include "ui_swiftguistd.h" #include "ui_swiftguistd.h"
#include "blackcore/dbusserver.h"
#include "blackcore/contextallinterfaces.h" #include "blackcore/contextallinterfaces.h"
#include "blackgui/stylesheetutility.h" #include "blackgui/stylesheetutility.h"
#include "blackgui/guiutility.h" #include "blackgui/guiutility.h"
#include "blackgui/components/allmaininfoareacomponents.h" #include "blackgui/components/allmaininfoareacomponents.h"
#include "blackgui/models/atcstationlistmodel.h" #include "blackgui/models/atcstationlistmodel.h"
#include "blackmisc/dbusserver.h"
#include "blackmisc/icons.h" #include "blackmisc/icons.h"
#include "blackmisc/aviation/selcal.h" #include "blackmisc/aviation/selcal.h"
#include "blackmisc/project.h" #include "blackmisc/project.h"

View File

@@ -10,8 +10,8 @@
#include "swiftlauncher.h" #include "swiftlauncher.h"
#include "ui_swiftlauncher.h" #include "ui_swiftlauncher.h"
#include "blackgui/stylesheetutility.h" #include "blackgui/stylesheetutility.h"
#include "blackcore/dbusserver.h"
#include "blackcore/setupreader.h" #include "blackcore/setupreader.h"
#include "blackmisc/dbusserver.h"
#include "blackmisc/network/networkutils.h" #include "blackmisc/network/networkutils.h"
#include "blackmisc/icons.h" #include "blackmisc/icons.h"
#include "blackmisc/project.h" #include "blackmisc/project.h"

View File

@@ -20,9 +20,9 @@ namespace XBus
CPlugin::CPlugin() CPlugin::CPlugin()
: m_menu(CMenu::mainMenu().subMenu("XBus")) : m_menu(CMenu::mainMenu().subMenu("XBus"))
{ {
m_startServerMenuItems.push_back(m_menu.item("Start server on session bus", [this]{ startServer(BlackCore::CDBusServer::sessionDBusServer()); })); m_startServerMenuItems.push_back(m_menu.item("Start server on session bus", [this]{ startServer(BlackMisc::CDBusServer::sessionDBusServer()); }));
m_startServerMenuItems.push_back(m_menu.item("Start server on system bus", [this]{ startServer(BlackCore::CDBusServer::systemDBusServer()); })); m_startServerMenuItems.push_back(m_menu.item("Start server on system bus", [this]{ startServer(BlackMisc::CDBusServer::systemDBusServer()); }));
m_startServerMenuItems.push_back(m_menu.item("Start server on localhost P2P", [this]{ startServer(BlackCore::CDBusServer::p2pAddress()); })); m_startServerMenuItems.push_back(m_menu.item("Start server on localhost P2P", [this]{ startServer(BlackMisc::CDBusServer::p2pAddress()); }));
} }
void CPlugin::startServer(const QString &address) void CPlugin::startServer(const QString &address)
@@ -30,7 +30,7 @@ namespace XBus
Q_ASSERT(! m_server); Q_ASSERT(! m_server);
for (auto &item : m_startServerMenuItems) { item.setEnabled(false); } for (auto &item : m_startServerMenuItems) { item.setEnabled(false); }
m_server = new BlackCore::CDBusServer(xbusServiceName(), address, this); m_server = new BlackMisc::CDBusServer(xbusServiceName(), address, this);
m_service = new CService(this); m_service = new CService(this);
m_traffic = new CTraffic(this); m_traffic = new CTraffic(this);
m_weather = new CWeather(this); m_weather = new CWeather(this);

View File

@@ -20,7 +20,7 @@
#pragma push_macro("interface") #pragma push_macro("interface")
#undef interface #undef interface
#include "blackcore/dbusserver.h" #include "blackmisc/dbusserver.h"
#pragma pop_macro("interface") #pragma pop_macro("interface")
#include <QVector> #include <QVector>
@@ -49,7 +49,7 @@ namespace XBus
void onAircraftRepositioned(); void onAircraftRepositioned();
private: private:
BlackCore::CDBusServer *m_server = nullptr; BlackMisc::CDBusServer *m_server = nullptr;
CService *m_service = nullptr; CService *m_service = nullptr;
CTraffic *m_traffic = nullptr; CTraffic *m_traffic = nullptr;
CWeather *m_weather = nullptr; CWeather *m_weather = nullptr;