Avoid issues if simulator is NOT yet set in emulateed driver

This commit is contained in:
Klaus Basan
2019-06-15 22:59:13 +02:00
committed by Mat Sutcliffe
parent 6bc2a15f61
commit 6cefb5175d
4 changed files with 29 additions and 15 deletions

View File

@@ -684,14 +684,23 @@ namespace BlackCore
// swift data
if (sApp && sApp->hasWebDataServices())
{
connect(sApp->getWebDataServices(), &CWebDataServices::swiftDbAllDataRead, this, &ISimulator::onSwiftDbAllDataRead, Qt::QueuedConnection);
connect(sApp->getWebDataServices(), &CWebDataServices::swiftDbAllDataRead, this, &ISimulator::onSwiftDbAllDataRead, Qt::QueuedConnection);
connect(sApp->getWebDataServices(), &CWebDataServices::swiftDbAirportsRead, this, &ISimulator::onSwiftDbAirportsRead, Qt::QueuedConnection);
connect(sApp->getWebDataServices(), &CWebDataServices::swiftDbModelMatchingEntitiesRead, this, &ISimulator::onSwiftDbModelMatchingEntitiesRead, Qt::QueuedConnection);
}
connect(sApp, &CApplication::aboutToShutdown, this, &ISimulator::unload, Qt::QueuedConnection);
// provider
this->setNewPluginInfo(pluginInfo, m_multiSettings.getSettings(pluginInfo.getSimulatorInfo()));
if (pluginInfo.isEmulatedPlugin() && !pluginInfo.getSimulatorInfo().isSingleSimulator())
{
// emulated driver with NO info yet
CLogMessage(this).info(u"Plugin '%1' with no simulator info yet, hope it will be set later") << pluginInfo.getIdentifier();
}
else
{
// NORMAL CASE or plugin with info already set
this->setNewPluginInfo(pluginInfo, m_multiSettings.getSettings(pluginInfo.getSimulatorInfo()));
}
// info data
m_simulatorInternals.setSimulatorName(this->getSimulatorName());