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

View File

@@ -191,11 +191,9 @@ namespace BlackMisc
signals: signals:
//! Parsing is finished or cache has been loaded //! 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); void loadingFinished(const CStatusMessageList &status, const CSimulatorInfo &simulator, LoadFinishedInfo info);
//! Corresponding Settings::CMultiSimulatorSettings::simulatorSettingsChange
void simulatorSettingsChanged(const CSimulatorInfo &simulator);
protected: protected:
//! Constructor //! Constructor
IAircraftModelLoader(const CSimulatorInfo &simulator); IAircraftModelLoader(const CSimulatorInfo &simulator);