refs #706, model string and DB key utility function

This commit is contained in:
Klaus Basan
2016-07-13 02:53:00 +02:00
parent 9810aa04b8
commit e497b43e06
2 changed files with 22 additions and 0 deletions

View File

@@ -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); }