mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
Ref T246, model loader must not fire signal if cache is changed elsewhere
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user