mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-13 07:35:41 +08:00
Style
This commit is contained in:
committed by
Roland Winklmeier
parent
45f48f7594
commit
9d37a0876d
@@ -245,12 +245,12 @@ namespace BlackCore
|
|||||||
Q_ASSERT(this->getIContextApplication());
|
Q_ASSERT(this->getIContextApplication());
|
||||||
Q_ASSERT(this->getIContextApplication()->isUsingImplementingObject());
|
Q_ASSERT(this->getIContextApplication()->isUsingImplementingObject());
|
||||||
|
|
||||||
if (this->m_simulator && this->m_simulator->getSimulatorInfo() == simulatorInfo) { return true; } // already loaded
|
if (this->m_simulator && this->m_simulator->getSimulatorInfo() == simulatorInfo) {
|
||||||
if (simulatorInfo.isUnspecified()) { return false; }
|
return true;
|
||||||
|
} // already loaded
|
||||||
|
|
||||||
// warning if we do not have any plugins
|
// warning if we do not have any plugins
|
||||||
if (m_simulatorFactories.isEmpty())
|
if (m_simulatorFactories.isEmpty()) {
|
||||||
{
|
|
||||||
CLogMessage(this).error("No simulator plugins");
|
CLogMessage(this).error("No simulator plugins");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,9 +116,7 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
int intervalMs = getUpdateIntervalMs();
|
int intervalMs = getUpdateIntervalMs();
|
||||||
this->m_updateTimer->startTimer(intervalMs);
|
this->m_updateTimer->startTimer(intervalMs);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
this->stopTimer();
|
this->stopTimer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -154,12 +154,15 @@ namespace BlackSimPlugin
|
|||||||
|
|
||||||
bool CSimulatorXPlane::connectTo()
|
bool CSimulatorXPlane::connectTo()
|
||||||
{
|
{
|
||||||
if (isConnected()) { return true; }
|
if (isConnected()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
m_conn = QDBusConnection::sessionBus(); // TODO make this configurable
|
m_conn = QDBusConnection::sessionBus(); // TODO make this configurable
|
||||||
m_service = new CXBusServiceProxy(m_conn, this);
|
m_service = new CXBusServiceProxy(m_conn, this);
|
||||||
m_traffic = new CXBusTrafficProxy(m_conn, this);
|
m_traffic = new CXBusTrafficProxy(m_conn, this);
|
||||||
if (m_service->isValid() && m_traffic->isValid() && m_traffic->initialize())
|
|
||||||
{
|
if (m_service->isValid() && m_traffic->isValid() && m_traffic->initialize()) {
|
||||||
// FIXME duplication
|
// FIXME duplication
|
||||||
connect(m_service, &CXBusServiceProxy::aircraftModelChanged, this, &CSimulatorXPlane::ps_emitOwnAircraftModelChanged);
|
connect(m_service, &CXBusServiceProxy::aircraftModelChanged, this, &CSimulatorXPlane::ps_emitOwnAircraftModelChanged);
|
||||||
connect(m_service, &CXBusServiceProxy::airportsInRangeUpdated, this, &CSimulatorXPlane::ps_setAirportsInRange);
|
connect(m_service, &CXBusServiceProxy::airportsInRangeUpdated, this, &CSimulatorXPlane::ps_setAirportsInRange);
|
||||||
@@ -167,9 +170,7 @@ namespace BlackSimPlugin
|
|||||||
m_watcher->setConnection(m_conn);
|
m_watcher->setConnection(m_conn);
|
||||||
emitSimulatorCombinedStatus();
|
emitSimulatorCombinedStatus();
|
||||||
return true;
|
return true;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
disconnectFrom();
|
disconnectFrom();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -183,8 +184,7 @@ namespace BlackSimPlugin
|
|||||||
|
|
||||||
bool CSimulatorXPlane::disconnectFrom()
|
bool CSimulatorXPlane::disconnectFrom()
|
||||||
{
|
{
|
||||||
if (m_traffic)
|
if (m_traffic) {
|
||||||
{
|
|
||||||
m_traffic->cleanup();
|
m_traffic->cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user