mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +08:00
Ref T298, better string handling/messages
This commit is contained in:
@@ -83,7 +83,7 @@ namespace BlackMisc
|
||||
{
|
||||
Q_UNUSED(i18n);
|
||||
static const QString s("%1 %2 %3");
|
||||
return s.arg(this->getDesignatorDbKey(), this->getCombinedType(), this->getWtc());
|
||||
return s.arg(this->getDesignatorDbKey(), this->getCombinedType(), this->getWtc()).trimmed();
|
||||
}
|
||||
|
||||
void CAircraftIcaoCode::updateMissingParts(const CAircraftIcaoCode &otherIcaoCode)
|
||||
|
||||
@@ -90,10 +90,9 @@ namespace BlackMisc
|
||||
|
||||
QString CAirlineIcaoCode::getDesignatorNameCountry() const
|
||||
{
|
||||
QString s(this->getDesignator());
|
||||
if (this->hasName()) { s = s.append(" ").append(this->getName()); }
|
||||
if (this->hasValidCountry()) { s = s.append(" ").append(this->getCountryIso()); }
|
||||
return s.trimmed();
|
||||
return this->getDesignator() %
|
||||
(this->hasName() ? (QStringLiteral(" ") % this->getName()) : QStringLiteral("")) %
|
||||
(this->hasValidCountry() ? (QStringLiteral(" ") % this->getCountryIso()) : QStringLiteral(""));
|
||||
}
|
||||
|
||||
QString CAirlineIcaoCode::getSimplifiedName() const
|
||||
|
||||
@@ -863,10 +863,12 @@ namespace BlackMisc
|
||||
const int score = model.calculateScore(remoteModel, preferColorLiveries, log ? &subMsgs : nullptr);
|
||||
if (ignoreZeroScores && score < 1) { continue; }
|
||||
|
||||
CMatchingUtils::addLogDetailsToList(log, remoteModel.getCallsign(), QString("--- Calculating #%1 '%2'---").arg(c++).arg(model.getModelStringAndDbKey()));
|
||||
static const QString bMsg("--- Calculating #%1 '%2'---");
|
||||
static const QString eMsg("--- End calculating #%1 ---");
|
||||
CMatchingUtils::addLogDetailsToList(log, remoteModel.getCallsign(), bMsg.arg(c).arg(model.getModelStringAndDbKey()));
|
||||
if (log) { log->push_back(subMsgs); }
|
||||
CMatchingUtils::addLogDetailsToList(log, remoteModel.getCallsign(), QString("--- End calculating #%1 ---").arg(c));
|
||||
|
||||
CMatchingUtils::addLogDetailsToList(log, remoteModel.getCallsign(), eMsg.arg(c));
|
||||
c++;
|
||||
scoreMap.insertMulti(score, model);
|
||||
}
|
||||
CMatchingUtils::addLogDetailsToList(log, remoteModel.getCallsign(), QStringLiteral("--- End scoring ---"));
|
||||
|
||||
Reference in New Issue
Block a user