mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
Ref T77, prefix for getDbKeyAsStringInParentheses
This commit is contained in:
@@ -336,7 +336,7 @@ namespace BlackMisc
|
||||
if (s.isEmpty()) s = "????";
|
||||
if (hasManufacturer()) { s = s.append(" ").append(getManufacturer()); }
|
||||
if (hasModelDescription()) { s = s.append(" ").append(getModelDescription()); }
|
||||
return s.append(" ").append(getDbKeyAsStringInParentheses());
|
||||
return s.append(getDbKeyAsStringInParentheses(" "));
|
||||
}
|
||||
|
||||
QString CAircraftIcaoCode::getCombinedIataStringWithKey() const
|
||||
@@ -347,7 +347,7 @@ namespace BlackMisc
|
||||
if (hasDesignator()) { s.append(" ").append(getDesignator()); }
|
||||
if (hasManufacturer()) { s = s.append(" ").append(getManufacturer()); }
|
||||
if (hasModelDescription()) { s = s.append(" ").append(getModelDescription()); }
|
||||
return s.append(" ").append(getDbKeyAsStringInParentheses());
|
||||
return s.append(getDbKeyAsStringInParentheses(" "));
|
||||
}
|
||||
|
||||
QString CAircraftIcaoCode::getCombinedFamilyStringWithKey() const
|
||||
@@ -358,7 +358,7 @@ namespace BlackMisc
|
||||
if (hasDesignator()) { s.append(" ").append(getDesignator()); }
|
||||
if (hasManufacturer()) { s.append(" ").append(getManufacturer()); }
|
||||
if (hasModelDescription()) { s.append(" ").append(getModelDescription()); }
|
||||
return s.append(" ").append(getDbKeyAsStringInParentheses());
|
||||
return s.append(getDbKeyAsStringInParentheses(" "));
|
||||
}
|
||||
|
||||
bool CAircraftIcaoCode::hasCompleteData() const
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace BlackMisc
|
||||
{
|
||||
if (this->isLoadedFromDb())
|
||||
{
|
||||
return this->getVDesignator() % QLatin1Char(' ') % this->getDbKeyAsStringInParentheses();
|
||||
return this->getVDesignator() % this->getDbKeyAsStringInParentheses(" ");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -350,7 +350,7 @@ namespace BlackMisc
|
||||
QString s(getVDesignator());
|
||||
if (s.isEmpty()) s = "????";
|
||||
if (hasName()) { s = s.append(" ").append(getName()); }
|
||||
return s.append(" ").append(getDbKeyAsStringInParentheses());
|
||||
return s.append(getDbKeyAsStringInParentheses(" "));
|
||||
}
|
||||
|
||||
CAirlineIcaoCode CAirlineIcaoCode::thisOrCallsignCode(const CCallsign &callsign) const
|
||||
|
||||
@@ -25,10 +25,10 @@ namespace BlackMisc
|
||||
return QString::number(this->m_dbKey);
|
||||
}
|
||||
|
||||
QString IDatastoreObjectWithIntegerKey::getDbKeyAsStringInParentheses() const
|
||||
QString IDatastoreObjectWithIntegerKey::getDbKeyAsStringInParentheses(const QString &prefix) const
|
||||
{
|
||||
if (this->m_dbKey < 0) { return ""; }
|
||||
return "(" + QString::number(this->m_dbKey) + ")";
|
||||
return prefix + "(" + QString::number(this->m_dbKey) + ")";
|
||||
}
|
||||
|
||||
void IDatastoreObjectWithIntegerKey::setDbKey(const QString &key)
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace BlackMisc
|
||||
QJsonValue getDbKeyAsJsonValue() const;
|
||||
|
||||
//! Db ley in parentheses, e.g. "(3)"
|
||||
QString getDbKeyAsStringInParentheses() const;
|
||||
QString getDbKeyAsStringInParentheses(const QString &prefix = {}) const;
|
||||
|
||||
//! Set the DB key
|
||||
void setDbKey(int key) { m_dbKey = key; }
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace BlackMisc
|
||||
QString s = this->m_realname;
|
||||
if (this->hasValidDbKey())
|
||||
{
|
||||
s.append(" ").append(this->getDbKeyAsStringInParentheses());
|
||||
s.append(this->getDbKeyAsStringInParentheses(" "));
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace BlackMisc
|
||||
Q_UNUSED(i18n);
|
||||
return "Role: " + m_name +
|
||||
" description: " + m_description +
|
||||
" " + this->getDbKeyAsStringInParentheses();
|
||||
this->getDbKeyAsStringInParentheses(" ");
|
||||
}
|
||||
|
||||
CVariant CRole::propertyByIndex(const CPropertyIndex &index) const
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace BlackMisc
|
||||
if (this->hasValidDbKey())
|
||||
{
|
||||
return this->hasModelString() ?
|
||||
QString(this->getModelString()).append(" ").append(this->getDbKeyAsStringInParentheses()) :
|
||||
QString(this->getModelString() + this->getDbKeyAsStringInParentheses(" ")) :
|
||||
this->getDbKeyAsString();
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user