From d9aac6427b6d451940cd98255936580acd6bc6c7 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Thu, 11 Feb 2016 22:14:20 +0100 Subject: [PATCH] refs #485, renamed (CContextRuntime) to CCoreFacade https://dev.vatsim-germany.org/issues/485#note-6 --- src/blackcore/context.h | 24 ++-- src/blackcore/contextapplication.cpp | 14 +- src/blackcore/contextapplication.h | 4 +- src/blackcore/contextapplicationempty.h | 6 +- src/blackcore/contextapplicationimpl.cpp | 6 +- src/blackcore/contextapplicationimpl.h | 8 +- src/blackcore/contextapplicationproxy.cpp | 2 +- src/blackcore/contextapplicationproxy.h | 4 +- src/blackcore/contextaudio.cpp | 8 +- src/blackcore/contextaudio.h | 4 +- src/blackcore/contextaudioempty.h | 2 +- src/blackcore/contextaudioimpl.cpp | 2 +- src/blackcore/contextaudioimpl.h | 8 +- src/blackcore/contextaudioproxy.cpp | 2 +- src/blackcore/contextaudioproxy.h | 4 +- src/blackcore/contextnetwork.cpp | 10 +- src/blackcore/contextnetwork.h | 4 +- src/blackcore/contextnetworkempty.h | 2 +- src/blackcore/contextnetworkimpl.cpp | 6 +- src/blackcore/contextnetworkimpl.h | 6 +- src/blackcore/contextnetworkproxy.cpp | 2 +- src/blackcore/contextnetworkproxy.h | 4 +- src/blackcore/contextownaircraft.cpp | 10 +- src/blackcore/contextownaircraft.h | 4 +- src/blackcore/contextownaircraftempty.h | 2 +- src/blackcore/contextownaircraftimpl.cpp | 4 +- src/blackcore/contextownaircraftimpl.h | 8 +- src/blackcore/contextownaircraftproxy.cpp | 2 +- src/blackcore/contextownaircraftproxy.h | 4 +- src/blackcore/contextsimulator.cpp | 10 +- src/blackcore/contextsimulator.h | 6 +- src/blackcore/contextsimulatorempty.h | 2 +- src/blackcore/contextsimulatorimpl.cpp | 4 +- src/blackcore/contextsimulatorimpl.h | 6 +- src/blackcore/contextsimulatorproxy.cpp | 2 +- src/blackcore/contextsimulatorproxy.h | 4 +- .../{contextruntime.cpp => corefacade.cpp} | 125 +++++------------- .../{contextruntime.h => corefacade.h} | 27 ++-- src/blackcore/corefacadeconfig.cpp | 69 ++++++++++ ...textruntimeconfig.h => corefacadeconfig.h} | 21 ++- src/blackgui/components/enableforruntime.cpp | 8 +- src/blackgui/components/enableforruntime.h | 24 ++-- .../components/mainkeypadareacomponent.cpp | 2 +- .../components/textmessagecomponent.cpp | 2 +- src/blackgui/guiutility.cpp | 4 +- src/swiftcore/main.cpp | 2 +- src/swiftcore/swiftcore.cpp | 6 +- src/swiftcore/swiftcore.h | 2 +- src/swiftdata/swiftdata.h | 2 +- src/swiftguistandard/main.cpp | 10 +- src/swiftguistandard/swiftguistd.h | 2 +- src/swiftguistandard/swiftguistdinit.cpp | 2 +- 52 files changed, 263 insertions(+), 245 deletions(-) rename src/blackcore/{contextruntime.cpp => corefacade.cpp} (77%) rename src/blackcore/{contextruntime.h => corefacade.h} (86%) create mode 100644 src/blackcore/corefacadeconfig.cpp rename src/blackcore/{contextruntimeconfig.h => corefacadeconfig.h} (77%) diff --git a/src/blackcore/context.h b/src/blackcore/context.h index 8f2b02c77..4ff0b11fb 100644 --- a/src/blackcore/context.h +++ b/src/blackcore/context.h @@ -13,8 +13,8 @@ #define BLACKCORE_CONTEXT_H #include "blackcoreexport.h" -#include "blackcore/contextruntimeconfig.h" -#include "blackcore/contextruntime.h" +#include "blackcore/corefacadeconfig.h" +#include "blackcore/corefacade.h" #include "blackmisc/logmessage.h" #include #include @@ -34,37 +34,37 @@ namespace BlackCore //! Using local implementing object? bool isUsingImplementingObject() const { - return m_mode == CRuntimeConfig::Local || m_mode == CRuntimeConfig::LocalInDbusServer; + return m_mode == CCoreFacadeConfig::Local || m_mode == CCoreFacadeConfig::LocalInDbusServer; } //! Local or remote object? bool isLocalObject() const { - return isUsingImplementingObject() || m_mode == CRuntimeConfig::NotUsed; + return isUsingImplementingObject() || m_mode == CCoreFacadeConfig::NotUsed; } //! Empty object? bool isEmptyObject() const { - return m_mode == CRuntimeConfig::NotUsed; + return m_mode == CCoreFacadeConfig::NotUsed; } //! Runtime - CRuntime *getRuntime() + CCoreFacade *getRuntime() { Q_ASSERT(this->parent()); - return static_cast(this->parent()); + return static_cast(this->parent()); } //! Const runtime - const CRuntime *getRuntime() const + const CCoreFacade *getRuntime() const { Q_ASSERT(this->parent()); - return static_cast(this->parent()); + return static_cast(this->parent()); } //! Mode - CRuntimeConfig::ContextMode getMode() const { return this->m_mode; } + CCoreFacadeConfig::ContextMode getMode() const { return this->m_mode; } //! Unique id qint64 getUniqueId() const { return this->m_contextId; } @@ -113,12 +113,12 @@ namespace BlackCore virtual QString getPathAndContextId() const = 0; protected: - CRuntimeConfig::ContextMode m_mode; //!< How context is used + CCoreFacadeConfig::ContextMode m_mode; //!< How context is used qint64 m_contextId; //!< unique identifer, avoid redirection rountrips bool m_debugEnabled = false; //!< debug messages enabled //! Constructor - CContext(CRuntimeConfig::ContextMode mode, QObject *parent) : + CContext(CCoreFacadeConfig::ContextMode mode, QObject *parent) : QObject(parent), m_mode(mode), m_contextId(QDateTime::currentMSecsSinceEpoch()) {} diff --git a/src/blackcore/contextapplication.cpp b/src/blackcore/contextapplication.cpp index 93a030c20..c5e5dd47f 100644 --- a/src/blackcore/contextapplication.cpp +++ b/src/blackcore/contextapplication.cpp @@ -25,25 +25,25 @@ using namespace BlackMisc; namespace BlackCore { - IContextApplication *IContextApplication::create(CRuntime *parent, CRuntimeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &connection) + IContextApplication *IContextApplication::create(CCoreFacade *parent, CCoreFacadeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &connection) { switch (mode) { - case CRuntimeConfig::Local: - case CRuntimeConfig::LocalInDbusServer: + case CCoreFacadeConfig::Local: + case CCoreFacadeConfig::LocalInDbusServer: return (new CContextApplication(mode, parent))->registerWithDBus(server); - case CRuntimeConfig::Remote: + case CCoreFacadeConfig::Remote: return new BlackCore::CContextApplicationProxy(BlackMisc::CDBusServer::coreServiceName(), connection, mode, parent); - case CRuntimeConfig::NotUsed: + case CCoreFacadeConfig::NotUsed: default: return new CContextApplicationEmpty(parent); } } - IContextApplication::IContextApplication(CRuntimeConfig::ContextMode mode, CRuntime *runtime) : + IContextApplication::IContextApplication(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : CContext(mode, runtime) { - if (mode == CRuntimeConfig::NotUsed) { return; } + if (mode == CCoreFacadeConfig::NotUsed) { return; } connect(CLogHandler::instance(), &CLogHandler::localMessageLogged, this, [this](const CStatusMessage & message) { this->logMessage(message, {}); diff --git a/src/blackcore/contextapplication.h b/src/blackcore/contextapplication.h index 4d85d07f2..786e2f41a 100644 --- a/src/blackcore/contextapplication.h +++ b/src/blackcore/contextapplication.h @@ -51,7 +51,7 @@ namespace BlackCore protected: //! Constructor - IContextApplication(CRuntimeConfig::ContextMode mode, CRuntime *runtime); + IContextApplication(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime); public: //! Service name @@ -72,7 +72,7 @@ namespace BlackCore virtual QString getPathAndContextId() const { return this->buildPathAndContextId(ObjectPath()); } //! Factory method - static IContextApplication *create(CRuntime *parent, CRuntimeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &conn); + static IContextApplication *create(CCoreFacade *parent, CCoreFacadeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &conn); //! Destructor virtual ~IContextApplication() {} diff --git a/src/blackcore/contextapplicationempty.h b/src/blackcore/contextapplicationempty.h index 2d4db587d..a0843878f 100644 --- a/src/blackcore/contextapplicationempty.h +++ b/src/blackcore/contextapplicationempty.h @@ -12,19 +12,19 @@ #include "blackcoreexport.h" #include "contextapplication.h" -#include "contextruntime.h" +#include "corefacade.h" #include "blackmisc/identifierlist.h" namespace BlackCore { - class CRuntime; + class CCoreFacade; //! Application context class BLACKCORE_EXPORT CContextApplicationEmpty : public IContextApplication { public: //! Constructor - CContextApplicationEmpty(CRuntime *runtime) : IContextApplication(CRuntimeConfig::NotUsed, runtime) {} + CContextApplicationEmpty(CCoreFacade *runtime) : IContextApplication(CCoreFacadeConfig::NotUsed, runtime) {} public slots: //! \copydoc IContextApplication::logMessage diff --git a/src/blackcore/contextapplicationimpl.cpp b/src/blackcore/contextapplicationimpl.cpp index 69a32f8b8..8b8bdd4a0 100644 --- a/src/blackcore/contextapplicationimpl.cpp +++ b/src/blackcore/contextapplicationimpl.cpp @@ -8,7 +8,7 @@ */ #include "contextapplicationimpl.h" -#include "contextruntime.h" +#include "corefacade.h" #include "inputmanager.h" #include "blackmisc/settingscache.h" #include "blackmisc/logmessage.h" @@ -20,7 +20,7 @@ using namespace BlackMisc; namespace BlackCore { - CContextApplication::CContextApplication(CRuntimeConfig::ContextMode mode, CRuntime *runtime) : + CContextApplication::CContextApplication(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : IContextApplication(mode, runtime) { connect(CSettingsCache::instance(), &CSettingsCache::valuesSaveRequested, CSettingsCache::instance(), &CSettingsCache::saveToStoreByPacket); @@ -28,7 +28,7 @@ namespace BlackCore CContextApplication *CContextApplication::registerWithDBus(BlackMisc::CDBusServer *server) { - if (!server || this->m_mode != CRuntimeConfig::LocalInDbusServer) { return this; } + if (!server || this->m_mode != CCoreFacadeConfig::LocalInDbusServer) { return this; } server->addObject(IContextApplication::ObjectPath(), this); return this; } diff --git a/src/blackcore/contextapplicationimpl.h b/src/blackcore/contextapplicationimpl.h index aedd7690c..84c18539c 100644 --- a/src/blackcore/contextapplicationimpl.h +++ b/src/blackcore/contextapplicationimpl.h @@ -12,20 +12,20 @@ #include "blackcoreexport.h" #include "contextapplication.h" -#include "contextruntime.h" +#include "corefacade.h" #include "blackmisc/dbusserver.h" #include "blackmisc/identifierlist.h" namespace BlackCore { - class CRuntime; + class CCoreFacade; //! Application context class BLACKCORE_EXPORT CContextApplication : public IContextApplication { Q_CLASSINFO("D-Bus Interface", BLACKCORE_CONTEXTAPPLICATION_INTERFACENAME) Q_OBJECT - friend class CRuntime; + friend class CCoreFacade; friend class IContextApplication; public slots: @@ -92,7 +92,7 @@ namespace BlackCore protected: //! Constructor - CContextApplication(CRuntimeConfig::ContextMode mode, CRuntime *runtime); + CContextApplication(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime); //! Register myself in DBus, fail safe CContextApplication *registerWithDBus(BlackMisc::CDBusServer *server); diff --git a/src/blackcore/contextapplicationproxy.cpp b/src/blackcore/contextapplicationproxy.cpp index 99ce83856..7c8b49e30 100644 --- a/src/blackcore/contextapplicationproxy.cpp +++ b/src/blackcore/contextapplicationproxy.cpp @@ -20,7 +20,7 @@ using namespace BlackMisc; namespace BlackCore { - CContextApplicationProxy::CContextApplicationProxy(const QString &serviceName, QDBusConnection &connection, CRuntimeConfig::ContextMode mode, CRuntime *runtime) : IContextApplication(mode, runtime), m_dBusInterface(nullptr) + CContextApplicationProxy::CContextApplicationProxy(const QString &serviceName, QDBusConnection &connection, CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : IContextApplication(mode, runtime), m_dBusInterface(nullptr) { this->m_dBusInterface = new CGenericDBusInterface(serviceName, IContextApplication::ObjectPath(), IContextApplication::InterfaceName(), connection, this); this->relaySignals(serviceName, connection); diff --git a/src/blackcore/contextapplicationproxy.h b/src/blackcore/contextapplicationproxy.h index cfafc0d9d..fc9aa976d 100644 --- a/src/blackcore/contextapplicationproxy.h +++ b/src/blackcore/contextapplicationproxy.h @@ -92,10 +92,10 @@ namespace BlackCore protected: //! Constructor - CContextApplicationProxy(CRuntimeConfig::ContextMode mode, CRuntime *runtime) : IContextApplication(mode, runtime), m_dBusInterface(nullptr) {} + CContextApplicationProxy(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : IContextApplication(mode, runtime), m_dBusInterface(nullptr) {} //! DBus version constructor - CContextApplicationProxy(const QString &serviceName, QDBusConnection &connection, CRuntimeConfig::ContextMode mode, CRuntime *runtime); + CContextApplicationProxy(const QString &serviceName, QDBusConnection &connection, CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime); private: BlackMisc::CGenericDBusInterface *m_dBusInterface; diff --git a/src/blackcore/contextaudio.cpp b/src/blackcore/contextaudio.cpp index 1f53ed732..2064b7ec1 100644 --- a/src/blackcore/contextaudio.cpp +++ b/src/blackcore/contextaudio.cpp @@ -15,14 +15,14 @@ namespace BlackCore { - IContextAudio *IContextAudio::create(CRuntime *runtime, CRuntimeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &conn) + IContextAudio *IContextAudio::create(CCoreFacade *runtime, CCoreFacadeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &conn) { switch (mode) { - case CRuntimeConfig::Local: - case CRuntimeConfig::LocalInDbusServer: + case CCoreFacadeConfig::Local: + case CCoreFacadeConfig::LocalInDbusServer: return (new CContextAudio(mode, runtime))->registerWithDBus(server); - case CRuntimeConfig::Remote: + case CCoreFacadeConfig::Remote: return new CContextAudioProxy(BlackMisc::CDBusServer::coreServiceName(), conn, mode, runtime); default: return new CContextAudioEmpty(runtime); // audio not mandatory diff --git a/src/blackcore/contextaudio.h b/src/blackcore/contextaudio.h index 6055ad795..50b2c473a 100644 --- a/src/blackcore/contextaudio.h +++ b/src/blackcore/contextaudio.h @@ -46,7 +46,7 @@ namespace BlackCore protected: //! Constructor - IContextAudio(CRuntimeConfig::ContextMode mode, CRuntime *runtime) : CContext(mode, runtime) {} + IContextAudio(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : CContext(mode, runtime) {} public: //! Interface name @@ -67,7 +67,7 @@ namespace BlackCore virtual QString getPathAndContextId() const { return this->buildPathAndContextId(ObjectPath()); } //! Factory method - static IContextAudio *create(CRuntime *runtime, CRuntimeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &conn); + static IContextAudio *create(CCoreFacade *runtime, CCoreFacadeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &conn); //! Destructor virtual ~IContextAudio() {} diff --git a/src/blackcore/contextaudioempty.h b/src/blackcore/contextaudioempty.h index 0a0990090..6b5a15828 100644 --- a/src/blackcore/contextaudioempty.h +++ b/src/blackcore/contextaudioempty.h @@ -26,7 +26,7 @@ namespace BlackCore { public: //! Constructor - CContextAudioEmpty(CRuntime *runtime) : IContextAudio(CRuntimeConfig::NotUsed, runtime) {} + CContextAudioEmpty(CCoreFacade *runtime) : IContextAudio(CCoreFacadeConfig::NotUsed, runtime) {} public slots: //! \copydoc IContextAudio::getComVoiceRooms() diff --git a/src/blackcore/contextaudioimpl.cpp b/src/blackcore/contextaudioimpl.cpp index 27d9a9f13..b778b7e9b 100644 --- a/src/blackcore/contextaudioimpl.cpp +++ b/src/blackcore/contextaudioimpl.cpp @@ -31,7 +31,7 @@ using namespace BlackSound; namespace BlackCore { - CContextAudio::CContextAudio(CRuntimeConfig::ContextMode mode, CRuntime *runtime) : + CContextAudio::CContextAudio(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : IContextAudio(mode, runtime), m_voice(new CVoiceVatlib()) { diff --git a/src/blackcore/contextaudioimpl.h b/src/blackcore/contextaudioimpl.h index 6a9f6dc6c..614a09624 100644 --- a/src/blackcore/contextaudioimpl.h +++ b/src/blackcore/contextaudioimpl.h @@ -14,7 +14,7 @@ #include "blackcore/blackcoreexport.h" #include "blackcore/contextaudio.h" -#include "blackcore/contextruntime.h" +#include "blackcore/corefacade.h" #include "blackcore/voice.h" #include "blackcore/voicechannel.h" #include "blackcore/audiodevice.h" @@ -40,7 +40,7 @@ namespace BlackCore Q_CLASSINFO("D-Bus Interface", BLACKCORE_CONTEXTAUDIO_INTERFACENAME) Q_OBJECT - friend class CRuntime; + friend class CCoreFacade; friend class IContextAudio; public: @@ -119,12 +119,12 @@ namespace BlackCore protected: //! Constructor - CContextAudio(CRuntimeConfig::ContextMode mode, CRuntime *runtime); + CContextAudio(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime); //! Register myself in DBus CContextAudio *registerWithDBus(BlackMisc::CDBusServer *server) { - if (!server || this->m_mode != CRuntimeConfig::LocalInDbusServer) { return this; } + if (!server || this->m_mode != CCoreFacadeConfig::LocalInDbusServer) { return this; } server->addObject(IContextAudio::ObjectPath(), this); return this; } diff --git a/src/blackcore/contextaudioproxy.cpp b/src/blackcore/contextaudioproxy.cpp index 54529ae0b..12aff0e17 100644 --- a/src/blackcore/contextaudioproxy.cpp +++ b/src/blackcore/contextaudioproxy.cpp @@ -20,7 +20,7 @@ namespace BlackCore /* * Constructor for DBus */ - CContextAudioProxy::CContextAudioProxy(const QString &serviceName, QDBusConnection &connection, CRuntimeConfig::ContextMode mode, CRuntime *runtime) : IContextAudio(mode, runtime), m_dBusInterface(nullptr) + CContextAudioProxy::CContextAudioProxy(const QString &serviceName, QDBusConnection &connection, CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : IContextAudio(mode, runtime), m_dBusInterface(nullptr) { this->m_dBusInterface = new BlackMisc::CGenericDBusInterface( serviceName, IContextAudio::ObjectPath(), IContextAudio::InterfaceName(), connection, this); diff --git a/src/blackcore/contextaudioproxy.h b/src/blackcore/contextaudioproxy.h index 0fba5a11b..a000e54a8 100644 --- a/src/blackcore/contextaudioproxy.h +++ b/src/blackcore/contextaudioproxy.h @@ -45,10 +45,10 @@ namespace BlackCore protected: //! Contructor - CContextAudioProxy(CRuntimeConfig::ContextMode mode, CRuntime *runtime) : IContextAudio(mode, runtime), m_dBusInterface(nullptr) {} + CContextAudioProxy(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : IContextAudio(mode, runtime), m_dBusInterface(nullptr) {} //! DBus version constructor - CContextAudioProxy(const QString &serviceName, QDBusConnection &connection, CRuntimeConfig::ContextMode mode, CRuntime *runtime); + CContextAudioProxy(const QString &serviceName, QDBusConnection &connection, CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime); public slots: //! \copydoc IContextAudio::getComVoiceRooms() diff --git a/src/blackcore/contextnetwork.cpp b/src/blackcore/contextnetwork.cpp index 32a2a17c1..6c410a01c 100644 --- a/src/blackcore/contextnetwork.cpp +++ b/src/blackcore/contextnetwork.cpp @@ -15,16 +15,16 @@ namespace BlackCore { - IContextNetwork *IContextNetwork::create(CRuntime *runtime, CRuntimeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &connection) + IContextNetwork *IContextNetwork::create(CCoreFacade *runtime, CCoreFacadeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &connection) { switch (mode) { - case CRuntimeConfig::Local: - case CRuntimeConfig::LocalInDbusServer: + case CCoreFacadeConfig::Local: + case CCoreFacadeConfig::LocalInDbusServer: return (new CContextNetwork(mode, runtime))->registerWithDBus(server); - case CRuntimeConfig::Remote: + case CCoreFacadeConfig::Remote: return new CContextNetworkProxy(BlackMisc::CDBusServer::coreServiceName(), connection, mode, runtime); - case CRuntimeConfig::NotUsed: + case CCoreFacadeConfig::NotUsed: default: return new CContextNetworkEmpty(runtime); } diff --git a/src/blackcore/contextnetwork.h b/src/blackcore/contextnetwork.h index db58a285a..69d580e76 100644 --- a/src/blackcore/contextnetwork.h +++ b/src/blackcore/contextnetwork.h @@ -65,7 +65,7 @@ namespace BlackCore virtual QString getPathAndContextId() const { return this->buildPathAndContextId(ObjectPath()); } //! Factory method - static IContextNetwork *create(CRuntime *parent, CRuntimeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &connection); + static IContextNetwork *create(CCoreFacade *parent, CCoreFacadeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &connection); //! Destructor virtual ~IContextNetwork() {} @@ -248,7 +248,7 @@ namespace BlackCore protected: //! Constructor - IContextNetwork(CRuntimeConfig::ContextMode mode, CRuntime *runtime) : CContext(mode, runtime) {} + IContextNetwork(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : CContext(mode, runtime) {} }; } diff --git a/src/blackcore/contextnetworkempty.h b/src/blackcore/contextnetworkempty.h index 5e2ca1fff..a3236853b 100644 --- a/src/blackcore/contextnetworkempty.h +++ b/src/blackcore/contextnetworkempty.h @@ -26,7 +26,7 @@ namespace BlackCore public: //! Constructor - CContextNetworkEmpty(CRuntime *runtime) : IContextNetwork(CRuntimeConfig::NotUsed, runtime) {} + CContextNetworkEmpty(CCoreFacade *runtime) : IContextNetwork(CCoreFacadeConfig::NotUsed, runtime) {} public slots: // IContextNetwork overrides diff --git a/src/blackcore/contextnetworkimpl.cpp b/src/blackcore/contextnetworkimpl.cpp index b67b26e59..739b5bee7 100644 --- a/src/blackcore/contextnetworkimpl.cpp +++ b/src/blackcore/contextnetworkimpl.cpp @@ -8,7 +8,7 @@ */ #include "contextnetworkimpl.h" -#include "contextruntime.h" +#include "corefacade.h" #include "contextapplication.h" #include "contextsimulator.h" #include "contextownaircraftimpl.h" @@ -37,7 +37,7 @@ using namespace BlackMisc::Weather; namespace BlackCore { - CContextNetwork::CContextNetwork(CRuntimeConfig::ContextMode mode, CRuntime *runtime) : + CContextNetwork::CContextNetwork(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : IContextNetwork(mode, runtime) { Q_ASSERT(this->getRuntime()); @@ -80,7 +80,7 @@ namespace BlackCore CContextNetwork *CContextNetwork::registerWithDBus(BlackMisc::CDBusServer *server) { - if (!server || this->m_mode != CRuntimeConfig::LocalInDbusServer) return this; + if (!server || this->m_mode != CCoreFacadeConfig::LocalInDbusServer) return this; server->addObject(IContextNetwork::ObjectPath(), this); return this; } diff --git a/src/blackcore/contextnetworkimpl.h b/src/blackcore/contextnetworkimpl.h index a1a102e70..179b44e81 100644 --- a/src/blackcore/contextnetworkimpl.h +++ b/src/blackcore/contextnetworkimpl.h @@ -14,7 +14,7 @@ #include "blackcoreexport.h" #include "blackcore/contextnetwork.h" -#include "blackcore/contextruntime.h" +#include "blackcore/corefacade.h" #include "blackcore/network.h" #include "blackmisc/dbusserver.h" #include "blackmisc/simulation/remoteaircraftprovider.h" @@ -44,7 +44,7 @@ namespace BlackCore Q_CLASSINFO("D-Bus Interface", BLACKCORE_CONTEXTNETWORK_INTERFACENAME) friend class IContextNetwork; - friend class CRuntime; + friend class CCoreFacade; public: //! Destructor @@ -230,7 +230,7 @@ namespace BlackCore protected: //! Constructor, with link to runtime - CContextNetwork(CRuntimeConfig::ContextMode, CRuntime *runtime); + CContextNetwork(CCoreFacadeConfig::ContextMode, CCoreFacade *runtime); //! Register myself in DBus CContextNetwork *registerWithDBus(BlackMisc::CDBusServer *server); diff --git a/src/blackcore/contextnetworkproxy.cpp b/src/blackcore/contextnetworkproxy.cpp index 648d2c18b..8ed4bb889 100644 --- a/src/blackcore/contextnetworkproxy.cpp +++ b/src/blackcore/contextnetworkproxy.cpp @@ -23,7 +23,7 @@ namespace BlackCore /* * Constructor for DBus */ - CContextNetworkProxy::CContextNetworkProxy(const QString &serviceName, QDBusConnection &connection, CRuntimeConfig::ContextMode mode, CRuntime *runtime) : IContextNetwork(mode, runtime), m_dBusInterface(nullptr) + CContextNetworkProxy::CContextNetworkProxy(const QString &serviceName, QDBusConnection &connection, CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : IContextNetwork(mode, runtime), m_dBusInterface(nullptr) { this->m_dBusInterface = new BlackMisc::CGenericDBusInterface( serviceName , IContextNetwork::ObjectPath(), IContextNetwork::InterfaceName(), diff --git a/src/blackcore/contextnetworkproxy.h b/src/blackcore/contextnetworkproxy.h index 6dba3e23e..320ce2fe7 100644 --- a/src/blackcore/contextnetworkproxy.h +++ b/src/blackcore/contextnetworkproxy.h @@ -47,10 +47,10 @@ namespace BlackCore protected: //! Constructor - CContextNetworkProxy(CRuntimeConfig::ContextMode mode, CRuntime *runtime) : IContextNetwork(mode, runtime), m_dBusInterface(nullptr) {} + CContextNetworkProxy(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : IContextNetwork(mode, runtime), m_dBusInterface(nullptr) {} //! DBus version constructor - CContextNetworkProxy(const QString &serviceName, QDBusConnection &connection, CRuntimeConfig::ContextMode mode, CRuntime *runtime); + CContextNetworkProxy(const QString &serviceName, QDBusConnection &connection, CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime); public slots: // IContextNetwork overrides diff --git a/src/blackcore/contextownaircraft.cpp b/src/blackcore/contextownaircraft.cpp index 9f24893ab..230ec47f2 100644 --- a/src/blackcore/contextownaircraft.cpp +++ b/src/blackcore/contextownaircraft.cpp @@ -14,16 +14,16 @@ namespace BlackCore { - IContextOwnAircraft *IContextOwnAircraft::create(CRuntime *parent, CRuntimeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &conn) + IContextOwnAircraft *IContextOwnAircraft::create(CCoreFacade *parent, CCoreFacadeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &conn) { switch (mode) { - case CRuntimeConfig::Local: - case CRuntimeConfig::LocalInDbusServer: + case CCoreFacadeConfig::Local: + case CCoreFacadeConfig::LocalInDbusServer: return (new CContextOwnAircraft(mode, parent))->registerWithDBus(server); - case CRuntimeConfig::Remote: + case CCoreFacadeConfig::Remote: return new CContextOwnAircraftProxy(BlackMisc::CDBusServer::coreServiceName(), conn, mode, parent); - case CRuntimeConfig::NotUsed: + case CCoreFacadeConfig::NotUsed: default: return new CContextOwnAircraftEmpty(parent); } diff --git a/src/blackcore/contextownaircraft.h b/src/blackcore/contextownaircraft.h index b5ad6dd31..352fa57de 100644 --- a/src/blackcore/contextownaircraft.h +++ b/src/blackcore/contextownaircraft.h @@ -59,7 +59,7 @@ namespace BlackCore virtual QString getPathAndContextId() const { return this->buildPathAndContextId(ObjectPath()); } //! Factory method - static IContextOwnAircraft *create(CRuntime *parent, CRuntimeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &conn); + static IContextOwnAircraft *create(CCoreFacade *parent, CCoreFacadeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &conn); //! Destructor virtual ~IContextOwnAircraft() {} @@ -122,7 +122,7 @@ namespace BlackCore protected: //! Constructor - IContextOwnAircraft(CRuntimeConfig::ContextMode mode, CRuntime *runtime) : CContext(mode, runtime) {} + IContextOwnAircraft(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : CContext(mode, runtime) {} }; } diff --git a/src/blackcore/contextownaircraftempty.h b/src/blackcore/contextownaircraftempty.h index 582a0bba5..943ee1f62 100644 --- a/src/blackcore/contextownaircraftempty.h +++ b/src/blackcore/contextownaircraftempty.h @@ -25,7 +25,7 @@ namespace BlackCore public: //! Constructor - CContextOwnAircraftEmpty(CRuntime *runtime) : IContextOwnAircraft(CRuntimeConfig::NotUsed, runtime) {} + CContextOwnAircraftEmpty(CCoreFacade *runtime) : IContextOwnAircraft(CCoreFacadeConfig::NotUsed, runtime) {} public slots: //! \copydoc IContextOwnAircraft::getOwnAircraft() diff --git a/src/blackcore/contextownaircraftimpl.cpp b/src/blackcore/contextownaircraftimpl.cpp index 5f89c4ffe..8510040e8 100644 --- a/src/blackcore/contextownaircraftimpl.cpp +++ b/src/blackcore/contextownaircraftimpl.cpp @@ -12,7 +12,7 @@ #include "contextnetwork.h" #include "contextaudio.h" #include "contextapplication.h" -#include "contextruntime.h" +#include "corefacade.h" #include "blackmisc/simplecommandparser.h" #include "blackmisc/logmessage.h" @@ -26,7 +26,7 @@ using namespace BlackMisc::Simulation; namespace BlackCore { - CContextOwnAircraft::CContextOwnAircraft(CRuntimeConfig::ContextMode mode, CRuntime *runtime) : + CContextOwnAircraft::CContextOwnAircraft(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : IContextOwnAircraft(mode, runtime), CIdentifiable(this) { diff --git a/src/blackcore/contextownaircraftimpl.h b/src/blackcore/contextownaircraftimpl.h index e0c299195..7598e84ac 100644 --- a/src/blackcore/contextownaircraftimpl.h +++ b/src/blackcore/contextownaircraftimpl.h @@ -14,7 +14,7 @@ #include "blackcoreexport.h" #include "blackcore/contextownaircraft.h" -#include "blackcore/contextruntime.h" +#include "blackcore/corefacade.h" #include "blackcore/settings/network.h" #include "blackmisc/dbusserver.h" #include "blackmisc/aviation/atcstation.h" @@ -34,7 +34,7 @@ namespace BlackCore Q_OBJECT Q_CLASSINFO("D-Bus Interface", BLACKCORE_CONTEXTOWNAIRCRAFT_INTERFACENAME) Q_INTERFACES(BlackMisc::Simulation::IOwnAircraftProvider) - friend class CRuntime; + friend class CCoreFacade; friend class IContextOwnAircraft; public: @@ -119,12 +119,12 @@ namespace BlackCore protected: //! Constructor, with link to runtime - CContextOwnAircraft(CRuntimeConfig::ContextMode, CRuntime *runtime); + CContextOwnAircraft(CCoreFacadeConfig::ContextMode, CCoreFacade *runtime); //! Register myself in DBus CContextOwnAircraft *registerWithDBus(BlackMisc::CDBusServer *server) { - if (!server || this->m_mode != CRuntimeConfig::LocalInDbusServer) return this; + if (!server || this->m_mode != CCoreFacadeConfig::LocalInDbusServer) return this; server->addObject(IContextOwnAircraft::ObjectPath(), this); return this; } diff --git a/src/blackcore/contextownaircraftproxy.cpp b/src/blackcore/contextownaircraftproxy.cpp index 7f0f692f4..ec22f7642 100644 --- a/src/blackcore/contextownaircraftproxy.cpp +++ b/src/blackcore/contextownaircraftproxy.cpp @@ -19,7 +19,7 @@ using namespace BlackMisc::Simulation; namespace BlackCore { - CContextOwnAircraftProxy::CContextOwnAircraftProxy(const QString &serviceName, QDBusConnection &connection, CRuntimeConfig::ContextMode mode, CRuntime *runtime) : IContextOwnAircraft(mode, runtime), m_dBusInterface(nullptr) + CContextOwnAircraftProxy::CContextOwnAircraftProxy(const QString &serviceName, QDBusConnection &connection, CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : IContextOwnAircraft(mode, runtime), m_dBusInterface(nullptr) { this->m_dBusInterface = new BlackMisc::CGenericDBusInterface( serviceName , IContextOwnAircraft::ObjectPath(), IContextOwnAircraft::InterfaceName(), diff --git a/src/blackcore/contextownaircraftproxy.h b/src/blackcore/contextownaircraftproxy.h index cd6ce6f9e..326c0cf48 100644 --- a/src/blackcore/contextownaircraftproxy.h +++ b/src/blackcore/contextownaircraftproxy.h @@ -70,10 +70,10 @@ namespace BlackCore protected: //! \brief Constructor - CContextOwnAircraftProxy(CRuntimeConfig::ContextMode mode, CRuntime *runtime) : IContextOwnAircraft(mode, runtime), m_dBusInterface(nullptr) {} + CContextOwnAircraftProxy(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : IContextOwnAircraft(mode, runtime), m_dBusInterface(nullptr) {} //! \brief DBus version constructor - CContextOwnAircraftProxy(const QString &serviceName, QDBusConnection &connection, CRuntimeConfig::ContextMode mode, CRuntime *runtime); + CContextOwnAircraftProxy(const QString &serviceName, QDBusConnection &connection, CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime); private: BlackMisc::CGenericDBusInterface *m_dBusInterface; //!< DBus interface */ diff --git a/src/blackcore/contextsimulator.cpp b/src/blackcore/contextsimulator.cpp index 65ab976e4..aabeb97ac 100644 --- a/src/blackcore/contextsimulator.cpp +++ b/src/blackcore/contextsimulator.cpp @@ -34,16 +34,16 @@ namespace BlackCore return t; } - IContextSimulator *IContextSimulator::create(CRuntime *parent, CRuntimeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &conn) + IContextSimulator *IContextSimulator::create(CCoreFacade *parent, CCoreFacadeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &conn) { switch (mode) { - case CRuntimeConfig::Local: - case CRuntimeConfig::LocalInDbusServer: + case CCoreFacadeConfig::Local: + case CCoreFacadeConfig::LocalInDbusServer: return (new CContextSimulator(mode, parent))->registerWithDBus(server); - case CRuntimeConfig::Remote: + case CCoreFacadeConfig::Remote: return new CContextSimulatorProxy(BlackMisc::CDBusServer::coreServiceName(), conn, mode, parent); - case CRuntimeConfig::NotUsed: + case CCoreFacadeConfig::NotUsed: default: return new CContextSimulatorEmpty(parent); } diff --git a/src/blackcore/contextsimulator.h b/src/blackcore/contextsimulator.h index 736f720e9..0a4711af4 100644 --- a/src/blackcore/contextsimulator.h +++ b/src/blackcore/contextsimulator.h @@ -26,7 +26,7 @@ #include "blackcoreexport.h" #include "context.h" #include "blackcore/simulator.h" -#include "blackcore/contextruntime.h" +#include "blackcore/corefacade.h" #include "blackmisc/dbusserver.h" #include "blackmisc/simulation/aircraftmodellist.h" #include "blackmisc/simulation/simulatorplugininfo.h" @@ -61,7 +61,7 @@ namespace BlackCore virtual QString getPathAndContextId() const { return this->buildPathAndContextId(ObjectPath()); } //! Factory method - static IContextSimulator *create(CRuntime *parent, CRuntimeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &conn); + static IContextSimulator *create(CCoreFacade *parent, CCoreFacadeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &conn); //! Destructor virtual ~IContextSimulator() {} @@ -178,7 +178,7 @@ namespace BlackCore protected: //! Constructor - IContextSimulator(CRuntimeConfig::ContextMode mode, CRuntime *runtime) : CContext(mode, runtime) {} + IContextSimulator(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : CContext(mode, runtime) {} }; } // namespace diff --git a/src/blackcore/contextsimulatorempty.h b/src/blackcore/contextsimulatorempty.h index 093d9143a..bc25b5255 100644 --- a/src/blackcore/contextsimulatorempty.h +++ b/src/blackcore/contextsimulatorempty.h @@ -25,7 +25,7 @@ namespace BlackCore public: //! Constructor - CContextSimulatorEmpty(CRuntime *runtime) : IContextSimulator(CRuntimeConfig::NotUsed, runtime) {} + CContextSimulatorEmpty(CCoreFacade *runtime) : IContextSimulator(CCoreFacadeConfig::NotUsed, runtime) {} public slots: //! \copydoc IContextSimulator::getSimulatorPluginInfo() diff --git a/src/blackcore/contextsimulatorimpl.cpp b/src/blackcore/contextsimulatorimpl.cpp index b40fe6081..794f0869b 100644 --- a/src/blackcore/contextsimulatorimpl.cpp +++ b/src/blackcore/contextsimulatorimpl.cpp @@ -13,7 +13,7 @@ #include "contextapplication.h" #include "contextnetworkimpl.h" #include "pluginmanagersimulator.h" -#include "contextruntime.h" +#include "corefacade.h" #include "blackcore/registermetadata.h" #include "blackmisc/propertyindexvariantmap.h" #include "blackmisc/logmessage.h" @@ -32,7 +32,7 @@ using namespace BlackMisc::Simulation; namespace BlackCore { - CContextSimulator::CContextSimulator(CRuntimeConfig::ContextMode mode, CRuntime *runtime) : + CContextSimulator::CContextSimulator(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : IContextSimulator(mode, runtime), m_plugins(new CPluginManagerSimulator(this)) { diff --git a/src/blackcore/contextsimulatorimpl.h b/src/blackcore/contextsimulatorimpl.h index 8982b6460..1f2f1b1fa 100644 --- a/src/blackcore/contextsimulatorimpl.h +++ b/src/blackcore/contextsimulatorimpl.h @@ -34,7 +34,7 @@ namespace BlackCore { Q_OBJECT Q_CLASSINFO("D-Bus Interface", BLACKCORE_CONTEXTSIMULATOR_INTERFACENAME) - friend class CRuntime; + friend class CCoreFacade; friend class IContextSimulator; public: @@ -125,12 +125,12 @@ namespace BlackCore protected: //! Constructor - CContextSimulator(CRuntimeConfig::ContextMode, CRuntime *runtime); + CContextSimulator(CCoreFacadeConfig::ContextMode, CCoreFacade *runtime); //! Register myself in DBus CContextSimulator *registerWithDBus(BlackMisc::CDBusServer *server) { - if (!server || this->m_mode != CRuntimeConfig::LocalInDbusServer) return this; + if (!server || this->m_mode != CCoreFacadeConfig::LocalInDbusServer) return this; server->addObject(CContextSimulator::ObjectPath(), this); return this; } diff --git a/src/blackcore/contextsimulatorproxy.cpp b/src/blackcore/contextsimulatorproxy.cpp index e998a51e8..247e44408 100644 --- a/src/blackcore/contextsimulatorproxy.cpp +++ b/src/blackcore/contextsimulatorproxy.cpp @@ -22,7 +22,7 @@ using namespace BlackMisc::Simulation; namespace BlackCore { - CContextSimulatorProxy::CContextSimulatorProxy(const QString &serviceName, QDBusConnection &connection, CRuntimeConfig::ContextMode mode, CRuntime *runtime) : IContextSimulator(mode, runtime), m_dBusInterface(nullptr) + CContextSimulatorProxy::CContextSimulatorProxy(const QString &serviceName, QDBusConnection &connection, CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : IContextSimulator(mode, runtime), m_dBusInterface(nullptr) { this->m_dBusInterface = new BlackMisc::CGenericDBusInterface( serviceName , IContextSimulator::ObjectPath(), IContextSimulator::InterfaceName(), diff --git a/src/blackcore/contextsimulatorproxy.h b/src/blackcore/contextsimulatorproxy.h index 5cf6371bc..358916855 100644 --- a/src/blackcore/contextsimulatorproxy.h +++ b/src/blackcore/contextsimulatorproxy.h @@ -38,10 +38,10 @@ namespace BlackCore protected: //! Constructor - CContextSimulatorProxy(CRuntimeConfig::ContextMode mode, CRuntime *runtime) : IContextSimulator(mode, runtime), m_dBusInterface(0) {} + CContextSimulatorProxy(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : IContextSimulator(mode, runtime), m_dBusInterface(0) {} //! DBus version constructor - CContextSimulatorProxy(const QString &serviceName, QDBusConnection &connection, CRuntimeConfig::ContextMode mode, CRuntime *runtime); + CContextSimulatorProxy(const QString &serviceName, QDBusConnection &connection, CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime); public slots: //! \copydoc IContextSimulator::getSimulatorPluginInfo() diff --git a/src/blackcore/contextruntime.cpp b/src/blackcore/corefacade.cpp similarity index 77% rename from src/blackcore/contextruntime.cpp rename to src/blackcore/corefacade.cpp index 46055a993..8049d94e7 100644 --- a/src/blackcore/contextruntime.cpp +++ b/src/blackcore/corefacade.cpp @@ -26,12 +26,12 @@ using namespace BlackMisc::Simulation; namespace BlackCore { - CRuntime::CRuntime(const CRuntimeConfig &config, QObject *parent) : QObject(parent) + CCoreFacade::CCoreFacade(const CCoreFacadeConfig &config, QObject *parent) : QObject(parent) { this->init(config); } - void CRuntime::init(const CRuntimeConfig &config) + void CCoreFacade::init(const CCoreFacadeConfig &config) { if (m_init) { return; } @@ -39,8 +39,6 @@ namespace BlackCore QTime time; registerMetadata(); - this->connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit, this, &CRuntime::gracefulShutdown); - // either use explicit setting or last value QString dbusAddress; if (config.hasDBusAddress()) @@ -102,20 +100,19 @@ namespace BlackCore m_init = true; } - bool CRuntime::hasRemoteApplicationContext() const + bool CCoreFacade::hasRemoteApplicationContext() const { Q_ASSERT(this->m_contextApplication); return !this->m_contextApplication->isUsingImplementingObject(); } - void CRuntime::registerMetadata() + void CCoreFacade::registerMetadata() { BlackMisc::registerMetadata(); BlackCore::registerMetadata(); - BlackMisc::initResources(); } - bool CRuntime::parseCommandLine(const QString &commandLine, const CIdentifier &originator) + bool CCoreFacade::parseCommandLine(const QString &commandLine, const CIdentifier &originator) { bool handled = false; if (this->getIContextAudio()) { handled = handled || this->getIContextAudio()->parseCommandLine(commandLine, originator); } @@ -124,7 +121,7 @@ namespace BlackCore return handled; } - void CRuntime::initDBusServer(const QString &dBusAddress) + void CCoreFacade::initDBusServer(const QString &dBusAddress) { if (this->m_dbusServer) { return; } Q_ASSERT(!dBusAddress.isEmpty()); @@ -132,7 +129,7 @@ namespace BlackCore CLogMessage(this).info("DBus server on address: %1") << dBusAddress; } - void CRuntime::initPostSetup(QMap ×) + void CCoreFacade::initPostSetup(QMap ×) { bool c = false; Q_UNUSED(c); // for release version @@ -207,7 +204,7 @@ namespace BlackCore } } - void CRuntime::gracefulShutdown() + void CCoreFacade::gracefulShutdown() { if (!this->m_init) return; this->m_init = false; @@ -229,7 +226,7 @@ namespace BlackCore } this->getIContextSimulator()->deleteLater(); QDBusConnection defaultConnection("default"); - this->m_contextSimulator = IContextSimulator::create(this, CRuntimeConfig::NotUsed, nullptr, defaultConnection); + this->m_contextSimulator = IContextSimulator::create(this, CCoreFacadeConfig::NotUsed, nullptr, defaultConnection); } // log off from network, if connected @@ -244,7 +241,7 @@ namespace BlackCore this->getIContextNetwork()->deleteLater(); // replace by dummy object avoiding nullptr issues during shutdown phase QDBusConnection defaultConnection("default"); - this->m_contextNetwork = IContextNetwork::create(this, CRuntimeConfig::NotUsed, nullptr, defaultConnection); + this->m_contextNetwork = IContextNetwork::create(this, CCoreFacadeConfig::NotUsed, nullptr, defaultConnection); } if (this->getIContextAudio()) @@ -253,7 +250,7 @@ namespace BlackCore this->getIContextAudio()->deleteLater(); // replace by dummy object avoiding nullptr issues during shutdown phase QDBusConnection defaultConnection("default"); - this->m_contextAudio = IContextAudio::create(this, CRuntimeConfig::NotUsed, nullptr, defaultConnection); + this->m_contextAudio = IContextAudio::create(this, CCoreFacadeConfig::NotUsed, nullptr, defaultConnection); } if (this->getIContextOwnAircraft()) @@ -261,7 +258,7 @@ namespace BlackCore disconnect(this->getIContextOwnAircraft()); this->getIContextOwnAircraft()->deleteLater(); QDBusConnection defaultConnection("default"); - this->m_contextOwnAircraft = IContextOwnAircraft::create(this, CRuntimeConfig::NotUsed, nullptr, defaultConnection); + this->m_contextOwnAircraft = IContextOwnAircraft::create(this, CCoreFacadeConfig::NotUsed, nullptr, defaultConnection); } if (this->getIContextApplication()) @@ -269,11 +266,11 @@ namespace BlackCore disconnect(this->getIContextApplication()); this->getIContextApplication()->deleteLater(); QDBusConnection defaultConnection("default"); - this->m_contextApplication = IContextApplication::create(this, CRuntimeConfig::NotUsed, nullptr, defaultConnection); + this->m_contextApplication = IContextApplication::create(this, CCoreFacadeConfig::NotUsed, nullptr, defaultConnection); } } - void CRuntime::initDBusConnection(const QString &address) + void CCoreFacade::initDBusConnection(const QString &address) { if (this->m_initDBusConnection) { return; } if (address.isEmpty() || address == CDBusServer::sessionBusAddress()) @@ -290,167 +287,113 @@ namespace BlackCore } } - const IContextApplication *CRuntime::getIContextApplication() const + const IContextApplication *CCoreFacade::getIContextApplication() const { return this->m_contextApplication; } - IContextApplication *CRuntime::getIContextApplication() + IContextApplication *CCoreFacade::getIContextApplication() { return this->m_contextApplication; } - IContextAudio *CRuntime::getIContextAudio() + IContextAudio *CCoreFacade::getIContextAudio() { return this->m_contextAudio; } - const IContextAudio *CRuntime::getIContextAudio() const + const IContextAudio *CCoreFacade::getIContextAudio() const { return this->m_contextAudio; } - IContextNetwork *CRuntime::getIContextNetwork() + IContextNetwork *CCoreFacade::getIContextNetwork() { return this->m_contextNetwork; } - const IContextNetwork *CRuntime::getIContextNetwork() const + const IContextNetwork *CCoreFacade::getIContextNetwork() const { return this->m_contextNetwork; } - IContextOwnAircraft *CRuntime::getIContextOwnAircraft() + IContextOwnAircraft *CCoreFacade::getIContextOwnAircraft() { return this->m_contextOwnAircraft; } - const IContextOwnAircraft *CRuntime::getIContextOwnAircraft() const + const IContextOwnAircraft *CCoreFacade::getIContextOwnAircraft() const { return this->m_contextOwnAircraft; } - const IContextSimulator *CRuntime::getIContextSimulator() const + const IContextSimulator *CCoreFacade::getIContextSimulator() const { return this->m_contextSimulator; } - IContextSimulator *CRuntime::getIContextSimulator() + IContextSimulator *CCoreFacade::getIContextSimulator() { return this->m_contextSimulator; } - CContextAudio *CRuntime::getCContextAudio() + CContextAudio *CCoreFacade::getCContextAudio() { Q_ASSERT_X(this->m_contextAudio && this->m_contextAudio->isUsingImplementingObject(), "CCoreRuntime", "Cannot downcast to local object"); return static_cast(this->m_contextAudio); } - const CContextAudio *CRuntime::getCContextAudio() const + const CContextAudio *CCoreFacade::getCContextAudio() const { Q_ASSERT_X(this->m_contextAudio && this->m_contextAudio->isUsingImplementingObject(), "CCoreRuntime", "Cannot downcast to local object"); return static_cast(this->m_contextAudio); } - CContextApplication *CRuntime::getCContextApplication() + CContextApplication *CCoreFacade::getCContextApplication() { Q_ASSERT_X(this->m_contextApplication && this->m_contextApplication->isUsingImplementingObject(), "CCoreRuntime", "Cannot downcast to local object"); return static_cast(this->m_contextApplication); } - const CContextApplication *CRuntime::getCContextApplication() const + const CContextApplication *CCoreFacade::getCContextApplication() const { Q_ASSERT_X(this->m_contextApplication && this->m_contextApplication->isUsingImplementingObject(), "CCoreRuntime", "Cannot downcast to local object"); return static_cast(this->m_contextApplication); } - CContextNetwork *CRuntime::getCContextNetwork() + CContextNetwork *CCoreFacade::getCContextNetwork() { Q_ASSERT_X(this->m_contextNetwork && this->m_contextNetwork->isUsingImplementingObject(), "CCoreRuntime", "Cannot downcast to local object"); return static_cast(this->m_contextNetwork); } - const CContextNetwork *CRuntime::getCContextNetwork() const + const CContextNetwork *CCoreFacade::getCContextNetwork() const { Q_ASSERT_X(this->m_contextNetwork && this->m_contextNetwork->isUsingImplementingObject(), "CCoreRuntime", "Cannot downcast to local object"); return static_cast(this->m_contextNetwork); } - CContextOwnAircraft *CRuntime::getCContextOwnAircraft() + CContextOwnAircraft *CCoreFacade::getCContextOwnAircraft() { Q_ASSERT_X(this->m_contextOwnAircraft && this->m_contextOwnAircraft->isUsingImplementingObject(), "CCoreRuntime", "Cannot downcast to local object"); return static_cast(this->m_contextOwnAircraft); } - const CContextOwnAircraft *CRuntime::getCContextOwnAircraft() const + const CContextOwnAircraft *CCoreFacade::getCContextOwnAircraft() const { Q_ASSERT_X(this->m_contextOwnAircraft && this->m_contextOwnAircraft->isUsingImplementingObject(), "CCoreRuntime", "Cannot downcast to local object"); return static_cast(this->m_contextOwnAircraft); } - CContextSimulator *CRuntime::getCContextSimulator() + CContextSimulator *CCoreFacade::getCContextSimulator() { Q_ASSERT_X(this->m_contextSimulator && this->m_contextSimulator->isUsingImplementingObject(), "CCoreRuntime", "Cannot downcast to local object"); return static_cast(this->m_contextSimulator); } - const CContextSimulator *CRuntime::getCContextSimulator() const + const CContextSimulator *CCoreFacade::getCContextSimulator() const { Q_ASSERT_X(this->m_contextSimulator && this->m_contextSimulator->isUsingImplementingObject(), "CCoreRuntime", "Cannot downcast to local object"); return static_cast(this->m_contextSimulator); } - - bool CRuntimeConfig::requiresDBusSever() const - { - return ( - // those 3 should decide whether we are running the server - this->m_network == LocalInDbusServer || - this->m_ownAircraft == LocalInDbusServer || - this->m_simulator == LocalInDbusServer || - - // added as work around - this->m_audio == LocalInDbusServer - ); - } - - bool CRuntimeConfig::requiresDBusConnection() const - { - return (this->m_application == Remote || - this->m_audio == Remote || - this->m_network == Remote || - this->m_ownAircraft == Remote || - this->m_simulator == Remote); - } - - const CRuntimeConfig &CRuntimeConfig::forCoreAllLocalInDBus(const QString &dbusBootstrapAddress) - { - static CRuntimeConfig cfg = CRuntimeConfig(CRuntimeConfig(CRuntimeConfig::LocalInDbusServer, dbusBootstrapAddress)); - return cfg; - } - - const CRuntimeConfig &CRuntimeConfig::forCoreAllLocalInDBusNoAudio(const QString &dbusBootstrapAddress) - { - static CRuntimeConfig cfg = CRuntimeConfig(CRuntimeConfig(CRuntimeConfig::LocalInDbusServer, dbusBootstrapAddress)); - cfg.m_audio = CRuntimeConfig::NotUsed; - return cfg; - } - - const CRuntimeConfig &CRuntimeConfig::local(const QString &dbusBootstrapAddress) - { - static CRuntimeConfig cfg = CRuntimeConfig(CRuntimeConfig(CRuntimeConfig::Local, dbusBootstrapAddress)); - return cfg; - } - - const CRuntimeConfig &CRuntimeConfig::remote(const QString &dbusBootstrapAddress) - { - static CRuntimeConfig cfg = CRuntimeConfig(CRuntimeConfig(CRuntimeConfig::Remote, dbusBootstrapAddress)); - return cfg; - } - - const CRuntimeConfig &CRuntimeConfig::remoteLocalAudio(const QString &dbusBootstrapAddress) - { - static CRuntimeConfig cfg = CRuntimeConfig(CRuntimeConfig(CRuntimeConfig::Remote, dbusBootstrapAddress)); - cfg.m_audio = CRuntimeConfig::LocalInDbusServer; - return cfg; - } } // namespace diff --git a/src/blackcore/contextruntime.h b/src/blackcore/corefacade.h similarity index 86% rename from src/blackcore/contextruntime.h rename to src/blackcore/corefacade.h index c2a7e0041..cce48fe56 100644 --- a/src/blackcore/contextruntime.h +++ b/src/blackcore/corefacade.h @@ -9,11 +9,11 @@ //! \file -#ifndef BLACKCORE_CONTEXT_RUNTIME_H -#define BLACKCORE_CONTEXT_RUNTIME_H +#ifndef BLACKCORE_COREFACADE_H +#define BLACKCORE_COREFACADE_H #include "blackcoreexport.h" -#include "blackcore/contextruntimeconfig.h" +#include "blackcore/corefacadeconfig.h" #include "blackcore/settings/network.h" #include "blackmisc/identifier.h" #include "blackmisc/statusmessagelist.h" @@ -41,17 +41,24 @@ namespace BlackCore class IContextOwnAircraft; class IContextSimulator; - //! The Context runtime class - class BLACKCORE_EXPORT CRuntime : public QObject + /*! + * The runtime class providing facades (the contexts) for all DBus relevant operations. + * - Initializes all contexts in correct order + * - Allows a ordered and correct shutdown + * - Connects all signal/slots between contexts + * (such cross context dependencies are not desired but sometimes required) + * - Loads the application settings + */ + class BLACKCORE_EXPORT CCoreFacade : public QObject { Q_OBJECT public: //! Constructor - CRuntime(const CRuntimeConfig &config, QObject *parent = nullptr); + CCoreFacade(const CCoreFacadeConfig &config, QObject *parent = nullptr); //! Destructor - virtual ~CRuntime() { this->gracefulShutdown(); } + virtual ~CCoreFacade() { this->gracefulShutdown(); } //! DBus server (if applicable) const BlackMisc::CDBusServer *getDBusServer() const { return this->m_dbusServer; } @@ -137,7 +144,7 @@ namespace BlackCore const CContextSimulator *getCContextSimulator() const; //! Init - void init(const CRuntimeConfig &config); + void init(const CCoreFacadeConfig &config); //! Remote application context, indicates distributed environment bool hasRemoteApplicationContext() const; @@ -155,8 +162,8 @@ namespace BlackCore // DBus BlackMisc::CDBusServer *m_dbusServer = nullptr; - QDBusConnection m_dbusConnection = QDBusConnection("default"); - bool m_initDBusConnection = false; + QDBusConnection m_dbusConnection = QDBusConnection("default"); + bool m_initDBusConnection = false; // contexts: // There is a reason why we do not use smart pointers here. When the context is deleted diff --git a/src/blackcore/corefacadeconfig.cpp b/src/blackcore/corefacadeconfig.cpp new file mode 100644 index 000000000..68f3366e2 --- /dev/null +++ b/src/blackcore/corefacadeconfig.cpp @@ -0,0 +1,69 @@ +/* Copyright (C) 2013 + * swift Project Community / Contributors + * + * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level + * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, + * including this file, may be copied, modified, propagated, or distributed except according to the terms + * contained in the LICENSE file. + */ + +#include "corefacadeconfig.h" +#include +#include + +namespace BlackCore +{ + bool CCoreFacadeConfig::requiresDBusSever() const + { + return ( + // those 3 should decide whether we are running the server + this->m_network == LocalInDbusServer || + this->m_ownAircraft == LocalInDbusServer || + this->m_simulator == LocalInDbusServer || + + // added as work around + this->m_audio == LocalInDbusServer + ); + } + + bool CCoreFacadeConfig::requiresDBusConnection() const + { + return (this->m_application == Remote || + this->m_audio == Remote || + this->m_network == Remote || + this->m_ownAircraft == Remote || + this->m_simulator == Remote); + } + + CCoreFacadeConfig CCoreFacadeConfig::forCoreAllLocalInDBus(const QString &dbusBootstrapAddress) + { + const CCoreFacadeConfig cfg = CCoreFacadeConfig(CCoreFacadeConfig(CCoreFacadeConfig::LocalInDbusServer, dbusBootstrapAddress)); + return cfg; + } + + CCoreFacadeConfig CCoreFacadeConfig::forCoreAllLocalInDBusNoAudio(const QString &dbusBootstrapAddress) + { + CCoreFacadeConfig cfg = CCoreFacadeConfig(CCoreFacadeConfig(CCoreFacadeConfig::LocalInDbusServer, dbusBootstrapAddress)); + cfg.m_audio = CCoreFacadeConfig::NotUsed; + return cfg; + } + + CCoreFacadeConfig CCoreFacadeConfig::local(const QString &dbusBootstrapAddress) + { + const CCoreFacadeConfig cfg = CCoreFacadeConfig(CCoreFacadeConfig(CCoreFacadeConfig::Local, dbusBootstrapAddress)); + return cfg; + } + + CCoreFacadeConfig CCoreFacadeConfig::remote(const QString &dbusBootstrapAddress) + { + const CCoreFacadeConfig cfg = CCoreFacadeConfig(CCoreFacadeConfig(CCoreFacadeConfig::Remote, dbusBootstrapAddress)); + return cfg; + } + + CCoreFacadeConfig CCoreFacadeConfig::remoteLocalAudio(const QString &dbusBootstrapAddress) + { + CCoreFacadeConfig cfg = CCoreFacadeConfig(CCoreFacadeConfig(CCoreFacadeConfig::Remote, dbusBootstrapAddress)); + cfg.m_audio = CCoreFacadeConfig::LocalInDbusServer; + return cfg; + } +} // namespace diff --git a/src/blackcore/contextruntimeconfig.h b/src/blackcore/corefacadeconfig.h similarity index 77% rename from src/blackcore/contextruntimeconfig.h rename to src/blackcore/corefacadeconfig.h index 1067e969b..011a89430 100644 --- a/src/blackcore/contextruntimeconfig.h +++ b/src/blackcore/corefacadeconfig.h @@ -9,8 +9,8 @@ //! \file -#ifndef BLACKCORE_CONTEXT_RUNTIME_CONFIG_H -#define BLACKCORE_CONTEXT_RUNTIME_CONFIG_H +#ifndef BLACKCORE_COREFACADECONFIG_H +#define BLACKCORE_COREFACADECONFIG_H #include "blackcoreexport.h" #include @@ -18,9 +18,8 @@ namespace BlackCore { //! Helper to correctly run a context - class BLACKCORE_EXPORT CRuntimeConfig + class BLACKCORE_EXPORT CCoreFacadeConfig { - public: //! How to handle a given context enum ContextMode @@ -42,13 +41,13 @@ namespace BlackCore public: //! Constructor - CRuntimeConfig(ContextMode allTheSame = NotUsed, const QString &dbusBootstrapAddress = ""): + CCoreFacadeConfig(ContextMode allTheSame = NotUsed, const QString &dbusBootstrapAddress = ""): m_application(allTheSame), m_audio(allTheSame), m_network(allTheSame), m_ownAircraft(allTheSame), m_settings(allTheSame), m_simulator(allTheSame), m_dbusAddress(dbusBootstrapAddress) {} //! Constructor - CRuntimeConfig(ContextMode application, ContextMode audio, ContextMode network, ContextMode ownAircraft, ContextMode settings, ContextMode simulator, const QString &dbusBootstrapAddress = ""): + CCoreFacadeConfig(ContextMode application, ContextMode audio, ContextMode network, ContextMode ownAircraft, ContextMode settings, ContextMode simulator, const QString &dbusBootstrapAddress = ""): m_application(application), m_audio(audio), m_network(network), m_ownAircraft(ownAircraft) , m_settings(settings), m_simulator(simulator), m_dbusAddress(dbusBootstrapAddress) {} @@ -87,19 +86,19 @@ namespace BlackCore bool hasDBusAddress() const { return !this->m_dbusAddress.isEmpty(); } //! predefined for Core - static const CRuntimeConfig &forCoreAllLocalInDBus(const QString &dbusBootstrapAddress = ""); + static CCoreFacadeConfig forCoreAllLocalInDBus(const QString &dbusBootstrapAddress = ""); //! predefined for Core - static const CRuntimeConfig &forCoreAllLocalInDBusNoAudio(const QString &dbusBootstrapAddress = ""); + static CCoreFacadeConfig forCoreAllLocalInDBusNoAudio(const QString &dbusBootstrapAddress = ""); //! predefined, completely local (e.g. for unit tests) - static const CRuntimeConfig &local(const QString &dbusBootstrapAddress = ""); + static CCoreFacadeConfig local(const QString &dbusBootstrapAddress = ""); //! predefined, completely remote (e.g. for GUI with core) - static const CRuntimeConfig &remote(const QString &dbusBootstrapAddress = ""); + static CCoreFacadeConfig remote(const QString &dbusBootstrapAddress = ""); //! predefined, remote with local audio (e.g. Aduio in GUI) - static const CRuntimeConfig &remoteLocalAudio(const QString &dbusBootstrapAddress = ""); + static CCoreFacadeConfig remoteLocalAudio(const QString &dbusBootstrapAddress = ""); }; } #endif // guard diff --git a/src/blackgui/components/enableforruntime.cpp b/src/blackgui/components/enableforruntime.cpp index 62c65e5e7..36e9b8359 100644 --- a/src/blackgui/components/enableforruntime.cpp +++ b/src/blackgui/components/enableforruntime.cpp @@ -17,7 +17,7 @@ namespace BlackGui { namespace Components { - void CEnableForRuntime::setRuntime(BlackCore::CRuntime *runtime, bool runtimeOwner) + void CEnableForRuntime::setRuntime(BlackCore::CCoreFacade *runtime, bool runtimeOwner) { Q_ASSERT(runtime); this->m_runtime = runtime; @@ -25,7 +25,7 @@ namespace BlackGui this->runtimeHasBeenSet(); } - void CEnableForRuntime::setRuntimeForComponents(BlackCore::CRuntime *runtime, QWidget *parent) + void CEnableForRuntime::setRuntimeForComponents(BlackCore::CCoreFacade *runtime, QWidget *parent) { if (!parent) return; @@ -39,9 +39,9 @@ namespace BlackGui } } - void CEnableForRuntime::createRuntime(const BlackCore::CRuntimeConfig &config, QObject *parent) + void CEnableForRuntime::createRuntime(const BlackCore::CCoreFacadeConfig &config, QObject *parent) { - this->m_runtime = new BlackCore::CRuntime(config, parent); + this->m_runtime = new BlackCore::CCoreFacade(config, parent); this->m_runtimeOwner = true; } diff --git a/src/blackgui/components/enableforruntime.h b/src/blackgui/components/enableforruntime.h index 60634859f..e46711dd2 100644 --- a/src/blackgui/components/enableforruntime.h +++ b/src/blackgui/components/enableforruntime.h @@ -13,14 +13,14 @@ #define BLACKGUI_ENABLEFORRUNTIME_H #include "blackgui/blackguiexport.h" -#include "blackcore/contextruntime.h" +#include "blackcore/corefacade.h" #include "blackmisc/audio/notificationsounds.h" #include namespace BlackCore { - class CRuntime; - class CRuntimeConfig; + class CCoreFacade; + class CCoreFacadeConfig; class IContextApplication; class IContextAudio; class IContextNetwork; @@ -37,15 +37,15 @@ namespace BlackGui //! Component, which provides references to runtime objects //! \details Access to runtime allows to encapsualate many aspects of data access and makes //! the component widely independent from a central data provideer - //! \sa BlackCore::CRuntime + //! \sa BlackCore::CCoreFacade class BLACKGUI_EXPORT CEnableForRuntime { public: //! Set runtime, usually set by runtime owner (must only be one, usually main window) - void setRuntime(BlackCore::CRuntime *runtime, bool runtimeOwner = false); + void setRuntime(BlackCore::CCoreFacade *runtime, bool runtimeOwner = false); //! Set runtime for each CRuntimeBasedComponent - static void setRuntimeForComponents(BlackCore::CRuntime *runtime, QWidget *parent); + static void setRuntimeForComponents(BlackCore::CCoreFacade *runtime, QWidget *parent); //! Log message category static const BlackMisc::CLogCategoryList &getLogCategories() @@ -58,18 +58,18 @@ namespace BlackGui //! Constructor //! \remarks Usually runtime will be provided later, not at initialization time. //! If runtime is provided right now, make sure to call runtimeHasBeenSet afterwards - CEnableForRuntime(BlackCore::CRuntime *runtime = nullptr, bool runtimeOwner = false) : + CEnableForRuntime(BlackCore::CCoreFacade *runtime = nullptr, bool runtimeOwner = false) : m_runtime(runtime), m_runtimeOwner(runtimeOwner) {} //! Runtime const - const BlackCore::CRuntime *getRuntime() const { return this->m_runtime;} + const BlackCore::CCoreFacade *getRuntime() const { return this->m_runtime;} //! Runtime non const - BlackCore::CRuntime *getRuntime() { return this->m_runtime;} + BlackCore::CCoreFacade *getRuntime() { return this->m_runtime;} //! Create a runtime (becomes owner). Only create one runtime. - void createRuntime(const BlackCore::CRuntimeConfig &config, QObject *parent); + void createRuntime(const BlackCore::CCoreFacadeConfig &config, QObject *parent); //! Context for application const BlackCore::IContextApplication *getIContextApplication() const; @@ -108,14 +108,14 @@ namespace BlackGui //! \remarks use this methods to hook up signal/slots with runtime virtual void runtimeHasBeenSet() {} - //! \copydoc BlackCore::CRuntime::hasRemoteApplicationContext + //! \copydoc BlackCore::CCoreFacade::hasRemoteApplicationContext bool hasRemoteApplicationContext() const { return this->m_runtime->hasRemoteApplicationContext(); } //! Play a given notification sound void playNotifcationSound(BlackMisc::Audio::CNotificationSounds::Notification notification) const; private: - BlackCore::CRuntime *m_runtime; + BlackCore::CCoreFacade *m_runtime; bool m_runtimeOwner; }; } diff --git a/src/blackgui/components/mainkeypadareacomponent.cpp b/src/blackgui/components/mainkeypadareacomponent.cpp index 1127ff668..9fa3c75a1 100644 --- a/src/blackgui/components/mainkeypadareacomponent.cpp +++ b/src/blackgui/components/mainkeypadareacomponent.cpp @@ -90,7 +90,7 @@ namespace BlackGui connect(this->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &CMainKeypadAreaComponent::ps_connectionStatusChanged); connect(this->getIContextOwnAircraft(), &IContextOwnAircraft::changedAircraftCockpit, this, &CMainKeypadAreaComponent::ps_ownAircraftCockpitChanged); connect(this->getIContextAudio(), &IContextAudio::changedMute, this, &CMainKeypadAreaComponent::ps_muteChanged); - connect(this, &CMainKeypadAreaComponent::commandEntered, this->getRuntime(), &CRuntime::parseCommandLine); + connect(this, &CMainKeypadAreaComponent::commandEntered, this->getRuntime(), &CCoreFacade::parseCommandLine); } void CMainKeypadAreaComponent::ps_buttonSelected() diff --git a/src/blackgui/components/textmessagecomponent.cpp b/src/blackgui/components/textmessagecomponent.cpp index 7057d89df..f8af3169a 100644 --- a/src/blackgui/components/textmessagecomponent.cpp +++ b/src/blackgui/components/textmessagecomponent.cpp @@ -169,7 +169,7 @@ namespace BlackGui connect(this->getIContextOwnAircraft(), &IContextOwnAircraft::changedAircraftCockpit, this, &CTextMessageComponent::ps_onChangedAircraftCockpit); connect(this->getDockWidgetInfoArea(), &CDockWidgetInfoArea::widgetTopLevelChanged, this, &CTextMessageComponent::ps_topLevelChanged); - connect(this, &CTextMessageComponent::commandEntered, this->getRuntime(), &CRuntime::parseCommandLine); + connect(this, &CTextMessageComponent::commandEntered, this->getRuntime(), &CCoreFacade::parseCommandLine); } /* diff --git a/src/blackgui/guiutility.cpp b/src/blackgui/guiutility.cpp index a60592cad..33614cf4d 100644 --- a/src/blackgui/guiutility.cpp +++ b/src/blackgui/guiutility.cpp @@ -8,7 +8,7 @@ */ #include "guiutility.h" -#include "blackcore/contextruntime.h" +#include "blackcore/corefacade.h" #include "blackcore/cookiemanager.h" #include "blackmisc/filelogger.h" #include "blackmisc/logmessage.h" @@ -71,7 +71,7 @@ namespace BlackGui void CGuiUtility::initSwiftGuiApplication(QApplication &a, const QString &applicationName, const QPixmap &icon) { - CRuntime::registerMetadata(); // register metadata + CCoreFacade::registerMetadata(); // register metadata CCookieManager::instance(); // init cookie manager if ever needed CLogHandler::instance()->install(); // make sure we have a log handler! diff --git a/src/swiftcore/main.cpp b/src/swiftcore/main.cpp index 2ca7d9d23..074f78734 100644 --- a/src/swiftcore/main.cpp +++ b/src/swiftcore/main.cpp @@ -8,7 +8,7 @@ */ #include "swiftcore.h" -#include "blackcore/contextruntime.h" +#include "blackcore/corefacade.h" #include "blackcore/contextapplication.h" #include "blackcore/contextapplicationimpl.h" #include "blackmisc/dbusserver.h" diff --git a/src/swiftcore/swiftcore.cpp b/src/swiftcore/swiftcore.cpp index 51c3c9610..3277106c5 100644 --- a/src/swiftcore/swiftcore.cpp +++ b/src/swiftcore/swiftcore.cpp @@ -143,11 +143,11 @@ void CSwiftCore::startCore(const SetupInfo &setup) // context this->createRuntime(setup.m_coreAudio ? - CRuntimeConfig::forCoreAllLocalInDBus(setup.m_dbusAddress) : - CRuntimeConfig::forCoreAllLocalInDBusNoAudio(setup.m_dbusAddress), + CCoreFacadeConfig::forCoreAllLocalInDBus(setup.m_dbusAddress) : + CCoreFacadeConfig::forCoreAllLocalInDBusNoAudio(setup.m_dbusAddress), this); CEnableForRuntime::setRuntimeForComponents(this->getRuntime(), this); - connect(ui->le_CommandLineInput, &CCommandInput::commandEntered, getRuntime(), &CRuntime::parseCommandLine); + connect(ui->le_CommandLineInput, &CCommandInput::commandEntered, getRuntime(), &CCoreFacade::parseCommandLine); } void CSwiftCore::stopCore() diff --git a/src/swiftcore/swiftcore.h b/src/swiftcore/swiftcore.h index 6211d2dd6..be69b7f37 100644 --- a/src/swiftcore/swiftcore.h +++ b/src/swiftcore/swiftcore.h @@ -12,7 +12,7 @@ #ifndef SWIFTCORE_H #define SWIFTCORE_H -#include "blackcore/contextruntime.h" +#include "blackcore/corefacade.h" #include "blackgui/systemtraywindow.h" #include "blackgui/components/enableforruntime.h" #include "blackmisc/statusmessage.h" diff --git a/src/swiftdata/swiftdata.h b/src/swiftdata/swiftdata.h index 8313534dd..464857439 100644 --- a/src/swiftdata/swiftdata.h +++ b/src/swiftdata/swiftdata.h @@ -12,7 +12,7 @@ #ifndef SWIFTDATA_H #define SWIFTDATA_H -#include "blackcore/contextruntime.h" +#include "blackcore/corefacade.h" #include "blackcore/data/globalsetup.h" #include "blackcore/data/updateinfo.h" #include "blackcore/setupreader.h" diff --git a/src/swiftguistandard/main.cpp b/src/swiftguistandard/main.cpp index 67d891f46..abe7d49c0 100644 --- a/src/swiftguistandard/main.cpp +++ b/src/swiftguistandard/main.cpp @@ -11,7 +11,7 @@ #include "guimodeenums.h" #include "blackgui/stylesheetutility.h" #include "blackcore/registermetadata.h" -#include "blackcore/contextruntimeconfig.h" +#include "blackcore/corefacadeconfig.h" #include "blackgui/guiutility.h" #include "blackmisc/blackmiscfreefunctions.h" #include "blackmisc/logmessage.h" @@ -132,17 +132,17 @@ int main(int argc, char *argv[]) return 0; } - BlackCore::CRuntimeConfig runtimeConfig; + BlackCore::CCoreFacadeConfig runtimeConfig; switch (coreMode) { case GuiModes::CoreExternalCoreAudio: - runtimeConfig = CRuntimeConfig::remote(dBusAddress); + runtimeConfig = CCoreFacadeConfig::remote(dBusAddress); break; case GuiModes::CoreInGuiProcess: - runtimeConfig = CRuntimeConfig::local(dBusAddress); + runtimeConfig = CCoreFacadeConfig::local(dBusAddress); break; case GuiModes::CoreExternalAudioGui: - runtimeConfig = CRuntimeConfig::remoteLocalAudio(dBusAddress); + runtimeConfig = CCoreFacadeConfig::remoteLocalAudio(dBusAddress); break; } diff --git a/src/swiftguistandard/swiftguistd.h b/src/swiftguistandard/swiftguistd.h index c4132c059..7427358b7 100644 --- a/src/swiftguistandard/swiftguistd.h +++ b/src/swiftguistandard/swiftguistd.h @@ -71,7 +71,7 @@ public: ~SwiftGuiStd(); //! Init data - void init(const BlackCore::CRuntimeConfig &runtimeConfig); + void init(const BlackCore::CCoreFacadeConfig &runtimeConfig); //! Log message category static QString getMessageCategory() { return "swift.gui.stdgui"; } diff --git a/src/swiftguistandard/swiftguistdinit.cpp b/src/swiftguistandard/swiftguistdinit.cpp index cb0def6f9..72516d2a8 100644 --- a/src/swiftguistandard/swiftguistdinit.cpp +++ b/src/swiftguistandard/swiftguistdinit.cpp @@ -29,7 +29,7 @@ using namespace BlackMisc::Input; using namespace BlackGui; using namespace BlackGui::Components; -void SwiftGuiStd::init(const CRuntimeConfig &runtimeConfig) +void SwiftGuiStd::init(const CCoreFacadeConfig &runtimeConfig) { // POST(!) GUI init