mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-14 00:25:35 +08:00
refs #641, using order in model caches
This commit is contained in:
@@ -98,12 +98,24 @@ namespace BlackMisc
|
|||||||
CStatusMessage CModelSetCaches::setCachedModels(const CAircraftModelList &models, const CSimulatorInfo &simulator)
|
CStatusMessage CModelSetCaches::setCachedModels(const CAircraftModelList &models, const CSimulatorInfo &simulator)
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "No single simulator");
|
Q_ASSERT_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "No single simulator");
|
||||||
|
CAircraftModelList m(models);
|
||||||
|
|
||||||
|
// make sure we have a proper order
|
||||||
|
if (m.needsOrder())
|
||||||
|
{
|
||||||
|
m.resetOrder();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m.sortAscendingByOrder();
|
||||||
|
}
|
||||||
|
|
||||||
switch (simulator.getSimulator())
|
switch (simulator.getSimulator())
|
||||||
{
|
{
|
||||||
case CSimulatorInfo::FS9: return this->m_modelCacheFs9.set(models);
|
case CSimulatorInfo::FS9: return this->m_modelCacheFs9.set(m);
|
||||||
case CSimulatorInfo::FSX: return this->m_modelCacheFsx.set(models);
|
case CSimulatorInfo::FSX: return this->m_modelCacheFsx.set(m);
|
||||||
case CSimulatorInfo::P3D: return this->m_modelCacheP3D.set(models);
|
case CSimulatorInfo::P3D: return this->m_modelCacheP3D.set(m);
|
||||||
case CSimulatorInfo::XPLANE: return this->m_modelCacheXP.set(models);
|
case CSimulatorInfo::XPLANE: return this->m_modelCacheXP.set(m);
|
||||||
default:
|
default:
|
||||||
Q_ASSERT_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "No single simulator");
|
Q_ASSERT_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "No single simulator");
|
||||||
return CStatusMessage();
|
return CStatusMessage();
|
||||||
|
|||||||
@@ -492,7 +492,7 @@ namespace BlackMisc
|
|||||||
emit valuesWantToCache({ { { element.m_key, value } }, timestamp, save });
|
emit valuesWantToCache({ { { element.m_key, value } }, timestamp, save });
|
||||||
}
|
}
|
||||||
// All good info
|
// All good info
|
||||||
status = CStatusMessage(this, CStatusMessage::SeverityInfo, "set values in cache");
|
status = CStatusMessage(this, CStatusMessage::SeverityInfo, "Set values in " + this->getKey(element));
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user