mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 06:35:52 +08:00
refs #706, model string and DB key utility function
This commit is contained in:
@@ -111,6 +111,25 @@ namespace BlackMisc
|
||||
return nw;
|
||||
}
|
||||
|
||||
QString CAircraftModel::getModelStringAndDbKey() const
|
||||
{
|
||||
if (this->hasValidDbKey())
|
||||
{
|
||||
if (this->hasModelString())
|
||||
{
|
||||
return QString(this->getModelString()).append(" ").append(this->getDbKeyAsStringInParentheses());
|
||||
}
|
||||
else
|
||||
{
|
||||
return this->getDbKeyAsString();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return this->getModelString();
|
||||
}
|
||||
}
|
||||
|
||||
CVariant CAircraftModel::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
|
||||
Reference in New Issue
Block a user