Fixes in model loader and caches

* loader/multi cache can clear caches if that is ever needed
* check if cache needs to be synchronized when loaded and if, do it
* emit changed signal if caches are set
This commit is contained in:
Klaus Basan
2018-07-20 18:11:54 +02:00
parent 562520dbab
commit d632d1ad4f
4 changed files with 89 additions and 25 deletions

View File

@@ -205,9 +205,14 @@ namespace BlackMisc
//! \threadsafe
QDateTime getCurrentCacheTimestamp() const;
//! Set cache
//! Set cached models
//! \threadsafe
virtual BlackMisc::CStatusMessage setCachedModels(const BlackMisc::Simulation::CAircraftModelList &models, const BlackMisc::Simulation::CSimulatorInfo &simulator) = 0;
//! Clear cached models
//! \threadsafe
virtual BlackMisc::CStatusMessage clearCachedModels(const BlackMisc::Simulation::CSimulatorInfo &simulator);
//! Synchronize for given simulator
virtual void synchronizeCache(const BlackMisc::Simulation::CSimulatorInfo &simulator) = 0;
@@ -264,7 +269,6 @@ namespace BlackMisc
//! Void version of synchronizeCurrentCache
void onLastSelectionChanged();
private:
//! Emit cacheChanged() utility function (allows breakpoint)
void emitCacheChanged(const BlackMisc::Simulation::CSimulatorInfo &simulator);
};