diff --git a/src/blackgui/runtimebasedcomponent.cpp b/src/blackgui/runtimebasedcomponent.cpp index 7f43e6213..187e143a5 100644 --- a/src/blackgui/runtimebasedcomponent.cpp +++ b/src/blackgui/runtimebasedcomponent.cpp @@ -3,29 +3,6 @@ namespace BlackGui { - const BlackCore::IContextApplication *CRuntimeBasedComponent::getIContextApplication() const - { - if (!this->m_runtime) return nullptr; - return this->m_runtime->getIContextApplication(); - } - - BlackCore::IContextApplication *CRuntimeBasedComponent::getIContextApplication() - { - if (!this->m_runtime) return nullptr; - return this->m_runtime->getIContextApplication(); - } - - BlackCore::IContextAudio *CRuntimeBasedComponent::getIContextAudio() - { - if (!this->m_runtime) return nullptr; - return this->m_runtime->getIContextAudio(); - } - - const BlackCore::IContextAudio *CRuntimeBasedComponent::getIContextAudio() const - { - if (!this->m_runtime) return nullptr; - return this->m_runtime->getIContextAudio(); - } void CRuntimeBasedComponent::setRuntime(BlackCore::CRuntime *runtime, bool runtimeOwner) { @@ -53,6 +30,42 @@ namespace BlackGui this->m_runtimeOwner = true; } + void CRuntimeBasedComponent::sendStatusMessage(const BlackMisc::CStatusMessage &statusMessage) + { + Q_ASSERT(this->getIContextApplication()); + this->getIContextApplication()->sendStatusMessage(statusMessage); + } + + void CRuntimeBasedComponent::sendStatusMessages(const BlackMisc::CStatusMessageList &statusMessages) + { + Q_ASSERT(this->getIContextApplication()); + this->getIContextApplication()->sendStatusMessages(statusMessages); + } + + const BlackCore::IContextApplication *CRuntimeBasedComponent::getIContextApplication() const + { + if (!this->m_runtime) return nullptr; + return this->m_runtime->getIContextApplication(); + } + + BlackCore::IContextApplication *CRuntimeBasedComponent::getIContextApplication() + { + if (!this->m_runtime) return nullptr; + return this->m_runtime->getIContextApplication(); + } + + BlackCore::IContextAudio *CRuntimeBasedComponent::getIContextAudio() + { + if (!this->m_runtime) return nullptr; + return this->m_runtime->getIContextAudio(); + } + + const BlackCore::IContextAudio *CRuntimeBasedComponent::getIContextAudio() const + { + if (!this->m_runtime) return nullptr; + return this->m_runtime->getIContextAudio(); + } + BlackCore::IContextNetwork *CRuntimeBasedComponent::getIContextNetwork() { if (!this->m_runtime) return nullptr; @@ -65,6 +78,18 @@ namespace BlackGui return this->m_runtime->getIContextNetwork(); } + BlackCore::IContextOwnAircraft *CRuntimeBasedComponent::getIContextOwnAircraft() + { + if (!this->m_runtime) return nullptr; + return this->m_runtime->getIContextOwnAircraft(); + } + + const BlackCore::IContextOwnAircraft *CRuntimeBasedComponent::getIContextOwnAircraft() const + { + if (!this->m_runtime) return nullptr; + return this->m_runtime->getIContextOwnAircraft(); + } + BlackCore::IContextSettings *CRuntimeBasedComponent::getIContextSettings() { if (!this->m_runtime) return nullptr; @@ -89,15 +114,4 @@ namespace BlackGui return this->m_runtime->getIContextSimulator(); } - void CRuntimeBasedComponent::sendStatusMessage(const BlackMisc::CStatusMessage &statusMessage) - { - Q_ASSERT(this->getIContextApplication()); - this->getIContextApplication()->sendStatusMessage(statusMessage); - } - - void CRuntimeBasedComponent::sendStatusMessages(const BlackMisc::CStatusMessageList &statusMessages) - { - Q_ASSERT(this->getIContextApplication()); - this->getIContextApplication()->sendStatusMessages(statusMessages); - } } diff --git a/src/blackgui/runtimebasedcomponent.h b/src/blackgui/runtimebasedcomponent.h index 5beca8225..d8456a3fb 100644 --- a/src/blackgui/runtimebasedcomponent.h +++ b/src/blackgui/runtimebasedcomponent.h @@ -39,11 +39,11 @@ namespace BlackGui //! Create a runtime (becomes owner). Only create one runtime. void createRuntime(const BlackCore::CRuntimeConfig &config, QObject *parent); - //! Context for network - BlackCore::IContextNetwork *getIContextNetwork(); + //! Context for application + const BlackCore::IContextApplication *getIContextApplication() const; - //! Context for network - const BlackCore::IContextNetwork *getIContextNetwork() const; + //! Context for application + BlackCore::IContextApplication *getIContextApplication(); //! Context for audio BlackCore::IContextAudio *getIContextAudio(); @@ -51,18 +51,24 @@ namespace BlackGui //! Context for audio const BlackCore::IContextAudio *getIContextAudio() const; + //! Context for network + BlackCore::IContextNetwork *getIContextNetwork(); + + //! Context for network + const BlackCore::IContextNetwork *getIContextNetwork() const; + + //! Context for own aircraft + const BlackCore::IContextOwnAircraft *getIContextOwnAircraft() const; + + //! Context for own aircraft + BlackCore::IContextOwnAircraft *getIContextOwnAircraft(); + //! Context for settings BlackCore::IContextSettings *getIContextSettings(); //! Context for settings const BlackCore::IContextSettings *getIContextSettings() const; - //! Context for application - const BlackCore::IContextApplication *getIContextApplication() const; - - //! Context for application - BlackCore::IContextApplication *getIContextApplication(); - //! Context for simulator const BlackCore::IContextSimulator *getIContextSimulator() const;