refs #535, updated aircraft model / view

* add functions to apply changes to selected objects
* allow to highlight models by their model strings
* Utility function to show which parts come from DB
* model strings can be obtained sorted/unsorted
This commit is contained in:
Klaus Basan
2015-12-13 19:40:04 +01:00
parent ecb4694c7f
commit 1601ca62fd
10 changed files with 156 additions and 30 deletions

View File

@@ -92,6 +92,8 @@ namespace BlackMisc
return m_livery.propertyByIndex(index.copyFrontRemoved());
case IndexCallsign:
return m_callsign.propertyByIndex(index.copyFrontRemoved());
case IndexPartsDbStatus:
return getPartsDbStatus();
default:
return CValueObject::propertyByIndex(index);
}
@@ -179,6 +181,8 @@ namespace BlackMisc
return Compare::compare(this->m_modelType, compareValue.getModelType());
case IndexModelMode:
return Compare::compare(this->m_modelMode, compareValue.getModelMode());
case IndexPartsDbStatus:
return getPartsDbStatus().compare(compareValue.getPartsDbStatus());
default:
break;
}
@@ -255,6 +259,16 @@ namespace BlackMisc
return m_simulator.isAnySimulator();
}
QString CAircraftModel::getPartsDbStatus() const
{
QString s(hasValidDbKey() ? "M" : "m");
s = s.append(getDistributor().hasValidDbKey() ? 'D' : 'd');
s = s.append(getAircraftIcaoCode().hasValidDbKey() ? 'A' : 'a');
s = s.append(getLivery().hasValidDbKey() ? 'L' : 'l');
s = s.append(getLivery().getAirlineIcaoCode().hasValidDbKey() ? 'A' : 'a');
return s;
}
bool CAircraftModel::matchesModelString(const QString &modelString, Qt::CaseSensitivity sensitivity) const
{
if (sensitivity == Qt::CaseSensitive)