refs #310, adjusted components / GUI to use renamed methods

This commit is contained in:
Klaus Basan
2014-10-08 19:09:54 +02:00
parent 9e23b0a2c0
commit 663740d5bd
6 changed files with 14 additions and 13 deletions

View File

@@ -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);
}

View File

@@ -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();

View File

@@ -90,7 +90,7 @@ namespace BlackGui
if (this->getIContextApplication())
{
if (this->getIContextApplication()->usingLocalObjects())
if (this->getIContextApplication()->isUsingImplementingObject())
{
this->ui->led_DBus->setOn(false);
}

View File

@@ -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)

View File

@@ -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);
}

View File

@@ -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"));