mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 04:45:31 +08:00
Ref T58, consolidation fixes
* override simulator, because values can be removed * DB simulator has priority
This commit is contained in:
@@ -75,6 +75,7 @@ namespace BlackCore
|
|||||||
CAircraftModel dbModelModified(dbModel);
|
CAircraftModel dbModelModified(dbModel);
|
||||||
dbModelModified.updateMissingParts(model);
|
dbModelModified.updateMissingParts(model);
|
||||||
dbModelModified.setDistributorOrder(distributorOrder);
|
dbModelModified.setDistributorOrder(distributorOrder);
|
||||||
|
dbModelModified.setSimulator(dbModel.getSimulator()); // DB simulator settings have priority
|
||||||
return dbModelModified;
|
return dbModelModified;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -538,14 +538,11 @@ namespace BlackMisc
|
|||||||
if (this->m_modelMode == Undefined) { this->m_modelType = otherModel.getModelType(); }
|
if (this->m_modelMode == Undefined) { this->m_modelType = otherModel.getModelType(); }
|
||||||
if (this->m_fileTimestamp < 0) { this->setFileTimestamp(otherModel.getFileTimestamp()); }
|
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_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());
|
this->setSimulator(otherModel.getSimulator());
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
this->m_simulator.add(otherModel.getSimulator());
|
|
||||||
}
|
|
||||||
|
|
||||||
this->m_livery.updateMissingParts(otherModel.getLivery());
|
this->m_livery.updateMissingParts(otherModel.getLivery());
|
||||||
this->m_aircraftIcao.updateMissingParts(otherModel.getAircraftIcaoCode());
|
this->m_aircraftIcao.updateMissingParts(otherModel.getAircraftIcaoCode());
|
||||||
@@ -665,7 +662,7 @@ namespace BlackMisc
|
|||||||
|
|
||||||
QString CAircraftModel::normalizeFileNameForDb(const QString &filePath)
|
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; }
|
if (n.count('/') < 2) { return n; }
|
||||||
return n.section('/', -2, -1);
|
return n.section('/', -2, -1);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user