diff --git a/src/blackcore/context_simulator_impl.cpp b/src/blackcore/context_simulator_impl.cpp index 2a42a2feb..5ee12ef9b 100644 --- a/src/blackcore/context_simulator_impl.cpp +++ b/src/blackcore/context_simulator_impl.cpp @@ -245,12 +245,12 @@ namespace BlackCore Q_ASSERT(this->getIContextApplication()); Q_ASSERT(this->getIContextApplication()->isUsingImplementingObject()); - if (this->m_simulator && this->m_simulator->getSimulatorInfo() == simulatorInfo) { return true; } // already loaded - if (simulatorInfo.isUnspecified()) { return false; } + if (this->m_simulator && this->m_simulator->getSimulatorInfo() == simulatorInfo) { + return true; + } // already loaded // warning if we do not have any plugins - if (m_simulatorFactories.isEmpty()) - { + if (m_simulatorFactories.isEmpty()) { CLogMessage(this).error("No simulator plugins"); return false; } diff --git a/src/blackgui/components/simulatorcomponent.cpp b/src/blackgui/components/simulatorcomponent.cpp index b7ed1d3f0..1e3b5fc9a 100644 --- a/src/blackgui/components/simulatorcomponent.cpp +++ b/src/blackgui/components/simulatorcomponent.cpp @@ -116,9 +116,7 @@ namespace BlackGui { int intervalMs = getUpdateIntervalMs(); this->m_updateTimer->startTimer(intervalMs); - } - else - { + } else { this->stopTimer(); } } diff --git a/src/plugins/simulator/xplane/simulator_xplane.cpp b/src/plugins/simulator/xplane/simulator_xplane.cpp index 67ecc2d51..9b57a2e4b 100644 --- a/src/plugins/simulator/xplane/simulator_xplane.cpp +++ b/src/plugins/simulator/xplane/simulator_xplane.cpp @@ -154,12 +154,15 @@ namespace BlackSimPlugin bool CSimulatorXPlane::connectTo() { - if (isConnected()) { return true; } + if (isConnected()) { + return true; + } + m_conn = QDBusConnection::sessionBus(); // TODO make this configurable m_service = new CXBusServiceProxy(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 connect(m_service, &CXBusServiceProxy::aircraftModelChanged, this, &CSimulatorXPlane::ps_emitOwnAircraftModelChanged); connect(m_service, &CXBusServiceProxy::airportsInRangeUpdated, this, &CSimulatorXPlane::ps_setAirportsInRange); @@ -167,9 +170,7 @@ namespace BlackSimPlugin m_watcher->setConnection(m_conn); emitSimulatorCombinedStatus(); return true; - } - else - { + } else { disconnectFrom(); return false; } @@ -183,8 +184,7 @@ namespace BlackSimPlugin bool CSimulatorXPlane::disconnectFrom() { - if (m_traffic) - { + if (m_traffic) { m_traffic->cleanup(); }