From 663740d5bd92148871c8cc815ea413412feb55a9 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Wed, 8 Oct 2014 19:09:54 +0200 Subject: [PATCH] refs #310, adjusted components / GUI to use renamed methods --- src/blackcore/context_simulator_impl.cpp | 5 +++-- src/blackgui/components/cockpitv1component.cpp | 2 +- src/blackgui/components/infobarstatuscomponent.cpp | 2 +- src/blackgui/components/settingsfsxcomponent.cpp | 10 +++++----- src/swiftgui_standard/mainwindow.cpp | 6 +++--- src/swiftgui_standard/mainwindow_init.cpp | 2 +- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/blackcore/context_simulator_impl.cpp b/src/blackcore/context_simulator_impl.cpp index d542e2dbe..efd631f3b 100644 --- a/src/blackcore/context_simulator_impl.cpp +++ b/src/blackcore/context_simulator_impl.cpp @@ -131,7 +131,7 @@ namespace BlackCore bool CContextSimulator::loadSimulatorPlugin(const CSimulatorInfo &simulatorInfo) { Q_ASSERT(this->getIContextApplication()); - Q_ASSERT(this->getIContextApplication()->usingLocalObjects()); + Q_ASSERT(this->getIContextApplication()->isUsingImplementingObject()); if (this->m_simulator && this->m_simulator->getSimulatorInfo() == simulatorInfo) { return true; } // already loaded if (simulatorInfo.isUnspecified()) { return false; } @@ -223,8 +223,9 @@ namespace BlackCore if (m_simulator) { // depending on shutdown order, network might already have been deleted - if (CContextNetwork *network = this->getRuntime()->getCContextNetwork()) + if (this->getRuntime()->getIContextNetwork()->isUsingImplementingObject()) { + CContextNetwork *network = this->getRuntime()->getCContextNetwork(); network->getAirspaceMonitor()->QObject::disconnect(this); } diff --git a/src/blackgui/components/cockpitv1component.cpp b/src/blackgui/components/cockpitv1component.cpp index 6f7b22ffa..961bbd613 100644 --- a/src/blackgui/components/cockpitv1component.cpp +++ b/src/blackgui/components/cockpitv1component.cpp @@ -152,7 +152,7 @@ namespace BlackGui { Q_ASSERT(this->getIContextOwnAircraft()); // direct object from local context - if (this->getIContextOwnAircraft()->usingLocalObjects()) return this->getRuntime()->getCContextOwnAircraft()->ownAircraft(); + if (this->getIContextOwnAircraft()->isUsingImplementingObject()) return this->getRuntime()->getCContextOwnAircraft()->ownAircraft(); // non local if (this->canPingApplicationContext()) return this->getIContextOwnAircraft()->getOwnAircraft(); diff --git a/src/blackgui/components/infobarstatuscomponent.cpp b/src/blackgui/components/infobarstatuscomponent.cpp index 97e781923..2c48e7c75 100644 --- a/src/blackgui/components/infobarstatuscomponent.cpp +++ b/src/blackgui/components/infobarstatuscomponent.cpp @@ -90,7 +90,7 @@ namespace BlackGui if (this->getIContextApplication()) { - if (this->getIContextApplication()->usingLocalObjects()) + if (this->getIContextApplication()->isUsingImplementingObject()) { this->ui->led_DBus->setOn(false); } diff --git a/src/blackgui/components/settingsfsxcomponent.cpp b/src/blackgui/components/settingsfsxcomponent.cpp index 645a6d6f2..56cb349ea 100644 --- a/src/blackgui/components/settingsfsxcomponent.cpp +++ b/src/blackgui/components/settingsfsxcomponent.cpp @@ -111,13 +111,13 @@ namespace BlackGui QString fileName = this->getIContextSimulator()->getSimulatorInfo().getSimulatorSetupValueAsString(CFsxSimulatorSetup::SetupSimConnectCfgFile); Q_ASSERT(!fileName.isEmpty()); // write either local or remote file - bool local = this->getIContextSimulator()->usingLocalObjects(); - bool success = local ? + bool localSimulatorObject = this->getIContextSimulator()->isUsingImplementingObject(); + bool success = localSimulatorObject ? BlackSim::Fsx::CSimConnectUtilities::writeSimConnectCfg(fileName, address, p) : this->getIContextApplication()->writeToFile(fileName, CSimConnectUtilities::simConnectCfg(address, p)); if (success) { - CLogMessage().info(this, local ? "Written local %1" : "Written remote %1") << fileName; + CLogMessage().info(this, localSimulatorObject ? "Written local %1" : "Written remote %1") << fileName; } else { @@ -149,7 +149,7 @@ namespace BlackGui if (!this->getIContextSimulator()) return; QString fileName = BlackSim::Fsx::CSimConnectUtilities::getLocalSimConnectCfgFilename(); QString m = QString("Deleted %1 ").append(fileName); - if (this->getIContextSimulator()->usingLocalObjects()) + if (this->getIContextSimulator()->isUsingImplementingObject()) { QFile f(fileName); f.remove(); @@ -166,7 +166,7 @@ namespace BlackGui { if (!this->getIContextSimulator()) return; QString fileName = BlackSim::Fsx::CSimConnectUtilities::getLocalSimConnectCfgFilename(); - bool exists = this->getIContextSimulator()->usingLocalObjects() ? + bool exists = this->getIContextSimulator()->isUsingImplementingObject() ? QFile::exists(fileName) : this->getIContextApplication()->existsFile(fileName); if (exists) diff --git a/src/swiftgui_standard/mainwindow.cpp b/src/swiftgui_standard/mainwindow.cpp index 9b79fbb48..cccc59e1e 100644 --- a/src/swiftgui_standard/mainwindow.cpp +++ b/src/swiftgui_standard/mainwindow.cpp @@ -383,8 +383,8 @@ void MainWindow::setContextAvailability() { qint64 t = QDateTime::currentMSecsSinceEpoch(); this->m_coreAvailable = this->getIContextApplication()->ping(t) == t; - this->m_contextNetworkAvailable = this->m_coreAvailable || this->getIContextNetwork()->usingLocalObjects(); - this->m_contextAudioAvailable = this->m_coreAvailable || this->getIContextAudio()->usingLocalObjects(); + this->m_contextNetworkAvailable = this->m_coreAvailable || this->getIContextNetwork()->isUsingImplementingObject(); + this->m_contextAudioAvailable = this->m_coreAvailable || this->getIContextAudio()->isUsingImplementingObject(); } /* @@ -396,7 +396,7 @@ void MainWindow::updateGuiStatusInformation() QString network("unavailable"); if (this->m_contextNetworkAvailable) { - bool dbus = !this->getIContextNetwork()->usingLocalObjects(); + bool dbus = !this->getIContextNetwork()->isUsingImplementingObject(); network = dbus ? now : "local"; this->ui->comp_InfoBarStatus->setDBusStatus(dbus); } diff --git a/src/swiftgui_standard/mainwindow_init.cpp b/src/swiftgui_standard/mainwindow_init.cpp index 5183c90dc..1a3198f2b 100644 --- a/src/swiftgui_standard/mainwindow_init.cpp +++ b/src/swiftgui_standard/mainwindow_init.cpp @@ -233,7 +233,7 @@ void MainWindow::initGuiSignals() void MainWindow::initialDataReads() { qint64 t = QDateTime::currentMSecsSinceEpoch(); - this->m_coreAvailable = (this->getIContextNetwork()->usingLocalObjects() || (this->getIContextApplication()->ping(t) == t)); + this->m_coreAvailable = (this->getIContextNetwork()->isUsingImplementingObject() || (this->getIContextApplication()->ping(t) == t)); if (!this->m_coreAvailable) { this->ps_displayStatusMessageInGui(CLogMessage().error(this, "no initial data read as network context is not available"));