Ref T246, model loader must not fire signal if cache is changed elsewhere

This commit is contained in:
Klaus Basan
2018-07-17 19:01:08 +02:00
parent 9d4989fab4
commit 235332bada
2 changed files with 6 additions and 7 deletions

View File

@@ -37,7 +37,7 @@ namespace BlackMisc
this->setObjectInfo(simulator);
// first connect is an internal connection to log info about load status
connect(this, &IAircraftModelLoader::loadingFinished, this, &IAircraftModelLoader::onLoadingFinished);
connect(this, &IAircraftModelLoader::loadingFinished, this, &IAircraftModelLoader::onLoadingFinished, Qt::QueuedConnection);
connect(&m_caches, &IMultiSimulatorModelCaches::cacheChanged, this, &IAircraftModelLoader::onCacheChanged);
connect(&m_settings, &CMultiSimulatorSettings::settingsChanged, this, &IAircraftModelLoader::onSettingsChanged);
}
@@ -141,13 +141,14 @@ namespace BlackMisc
void IAircraftModelLoader::onCacheChanged(const CSimulatorInfo &simInfo)
{
static const CStatusMessage status(this, CStatusMessage::SeverityInfo, "Cached changed");
emit this->loadingFinished(status, simInfo, CacheLoaded);
// this detects a loaded cache elsewhere
Q_UNUSED(simInfo);
}
void IAircraftModelLoader::onSettingsChanged(const CSimulatorInfo &simInfo)
{
emit this->simulatorSettingsChanged(simInfo);
// this detects changed settings elsewhere
Q_UNUSED(simInfo);
}
QStringList IAircraftModelLoader::getInitializedModelDirectories(const QStringList &modelDirectories, const CSimulatorInfo &simulator) const

View File

@@ -191,11 +191,9 @@ namespace BlackMisc
signals:
//! Parsing is finished or cache has been loaded
//! \remark does to fire if the cache has been changed elsewhere and it has just been reloaded here!
void loadingFinished(const CStatusMessageList &status, const CSimulatorInfo &simulator, LoadFinishedInfo info);
//! Corresponding Settings::CMultiSimulatorSettings::simulatorSettingsChange
void simulatorSettingsChanged(const CSimulatorInfo &simulator);
protected:
//! Constructor
IAircraftModelLoader(const CSimulatorInfo &simulator);