Ref T58, consolidation fixes

* override simulator, because values can be removed
* DB simulator has priority
This commit is contained in:
Klaus Basan
2017-05-07 04:27:20 +02:00
parent cdfa2530b6
commit 92472e78a6
2 changed files with 4 additions and 6 deletions

View File

@@ -75,6 +75,7 @@ namespace BlackCore
CAircraftModel dbModelModified(dbModel);
dbModelModified.updateMissingParts(model);
dbModelModified.setDistributorOrder(distributorOrder);
dbModelModified.setSimulator(dbModel.getSimulator()); // DB simulator settings have priority
return dbModelModified;
}

View File

@@ -538,14 +538,11 @@ namespace BlackMisc
if (this->m_modelMode == Undefined) { this->m_modelType = otherModel.getModelType(); }
if (this->m_fileTimestamp < 0) { this->setFileTimestamp(otherModel.getFileTimestamp()); }
if (this->m_description.isEmpty() || this->m_description.startsWith(CAircraftModel::autoGenerated(), Qt::CaseInsensitive)) { this->setDescription(otherModel.getDescription()); }
if (this->m_simulator.isUnspecified())
if (this->getSimulator().isUnspecified())
{
// simulator can only be overridden as simulators can also be removed
this->setSimulator(otherModel.getSimulator());
}
else
{
this->m_simulator.add(otherModel.getSimulator());
}
this->m_livery.updateMissingParts(otherModel.getLivery());
this->m_aircraftIcao.updateMissingParts(otherModel.getAircraftIcaoCode());
@@ -665,7 +662,7 @@ namespace BlackMisc
QString CAircraftModel::normalizeFileNameForDb(const QString &filePath)
{
QString n = CFileUtils::normalizeFilePathToQtStandard(filePath).toUpper();
const QString n = CFileUtils::normalizeFilePathToQtStandard(filePath).toUpper();
if (n.count('/') < 2) { return n; }
return n.section('/', -2, -1);
}