mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 09:15:34 +08:00
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:
@@ -218,6 +218,8 @@ namespace BlackMisc
|
||||
Q_ASSERT_X(false, Q_FUNC_INFO, "wrong simulator");
|
||||
return CStatusMessage();
|
||||
}
|
||||
|
||||
this->emitCacheChanged(simulator);
|
||||
}
|
||||
|
||||
QDateTime IMultiSimulatorModelCaches::getCurrentCacheTimestamp() const
|
||||
@@ -228,6 +230,28 @@ namespace BlackMisc
|
||||
return this->getCacheTimestamp(sim);
|
||||
}
|
||||
|
||||
CStatusMessage IMultiSimulatorModelCaches::clearCachedModels(const CSimulatorInfo &simulator)
|
||||
{
|
||||
static const CAircraftModelList models;
|
||||
return this->setCachedModels(models, simulator);
|
||||
}
|
||||
|
||||
void IMultiSimulatorModelCaches::synchronizeMultiCaches(const CSimulatorInfo &simulator)
|
||||
{
|
||||
for (const CSimulatorInfo &singleSimulator : simulator.asSingleSimulatorSet())
|
||||
{
|
||||
this->synchronizeCache(singleSimulator);
|
||||
}
|
||||
}
|
||||
|
||||
void IMultiSimulatorModelCaches::admitMultiCaches(const CSimulatorInfo &simulator)
|
||||
{
|
||||
for (const CSimulatorInfo &singleSimulator : simulator.asSingleSimulatorSet())
|
||||
{
|
||||
this->admitMultiCaches(singleSimulator);
|
||||
}
|
||||
}
|
||||
|
||||
QDateTime CModelCaches::getCacheTimestamp(const CSimulatorInfo &simulator) const
|
||||
{
|
||||
Q_ASSERT_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "No single simulator");
|
||||
@@ -410,6 +434,8 @@ namespace BlackMisc
|
||||
Q_ASSERT_X(false, Q_FUNC_INFO, "wrong simulator");
|
||||
return CStatusMessage();
|
||||
}
|
||||
|
||||
this->emitCacheChanged(simulator);
|
||||
}
|
||||
|
||||
QDateTime CModelSetCaches::getCacheTimestamp(const CSimulatorInfo &simulator) const
|
||||
|
||||
Reference in New Issue
Block a user