Ref T786, enable weather in sim. if plugin changed

This commit is contained in:
Klaus Basan
2020-04-21 17:37:45 +02:00
committed by Mat Sutcliffe
parent 387d47ebf8
commit 5678052b5d

View File

@@ -566,21 +566,24 @@ namespace BlackCore
// Emit signal after this function completes completely decoupled
QPointer<CContextSimulator> 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;
}