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