refs #619, enhance local model data with DB data (if possible)

* use new slot syntax on menu actions
* allow reload from disk and reload from cache
* added utility functions for model/modellist
This commit is contained in:
Klaus Basan
2016-03-13 19:30:26 +01:00
parent 76fa1535af
commit 93176b5bd4
13 changed files with 229 additions and 73 deletions

View File

@@ -266,6 +266,11 @@ namespace BlackMisc
return this->m_aircraftIcao.hasDesignator();
}
bool CAircraftModel::hasKnownAircraftDesignator() const
{
return this->m_aircraftIcao.hasKnownDesignator();
}
bool CAircraftModel::hasAirlineDesignator() const
{
return this->m_livery.hasValidAirlineDesignator();
@@ -291,9 +296,9 @@ namespace BlackMisc
this->setModelMode(CAircraftModel::modelModeFromString(mode));
}
void CAircraftModel::updateMissingParts(const CAircraftModel &otherModel)
void CAircraftModel::updateMissingParts(const CAircraftModel &otherModel, bool dbModelPriority)
{
if (!this->hasValidDbKey() && otherModel.hasValidDbKey())
if (dbModelPriority && !this->hasValidDbKey() && otherModel.hasValidDbKey())
{
// we have no DB data, but the other one has
// so we change roles. We take the DB object as base, and update our parts