From 5678052b5dffe5e7fa09dfe1564a8551b344b040 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Tue, 21 Apr 2020 17:37:45 +0200 Subject: [PATCH] Ref T786, enable weather in sim. if plugin changed --- src/blackcore/context/contextsimulatorimpl.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/blackcore/context/contextsimulatorimpl.cpp b/src/blackcore/context/contextsimulatorimpl.cpp index 6ae13432a..1f5a1bd89 100644 --- a/src/blackcore/context/contextsimulatorimpl.cpp +++ b/src/blackcore/context/contextsimulatorimpl.cpp @@ -566,21 +566,24 @@ namespace BlackCore // Emit signal after this function completes completely decoupled QPointer myself(this); - QTimer::singleShot(0, this, [ = ] + QTimer::singleShot(25, this, [ = ] { - if (!myself) { return; } + if (!myself || !sApp || sApp->isShuttingDown()) { return; } if (m_simulatorPlugin.second) { + CLogMessage(this).info(u"Simulator plugin loaded: '%1' connected: %2") + << simulatorPluginInfo.toQString(true) + << boolToYesNo(connected); + + // weather in sim. + this->setWeatherActivated(m_isWeatherActivated); + // use the real driver as this will also work eith emulated driver emit this->simulatorPluginChanged(m_simulatorPlugin.second->getSimulatorPluginInfo()); emit this->simulatorChanged(m_simulatorPlugin.second->getSimulatorInfo()); } }); - CLogMessage(this).info(u"Simulator plugin loaded: '%1' connected: %2") - << simulatorPluginInfo.toQString(true) - << boolToYesNo(connected); - return true; }