Formatting, #825 (matching)

This commit is contained in:
Klaus Basan
2017-03-08 01:17:50 +01:00
committed by Mathew Sutcliffe
parent eabb576b67
commit 35c685b344
5 changed files with 16 additions and 16 deletions

View File

@@ -24,6 +24,7 @@
#include <QList> #include <QList>
#include <QStringList> #include <QStringList>
#include <QtGlobal> #include <QtGlobal>
#include <QStringBuilder>
using namespace BlackMisc; using namespace BlackMisc;
using namespace BlackMisc::Simulation; using namespace BlackMisc::Simulation;
@@ -239,8 +240,7 @@ namespace BlackCore
CMatchingUtils::addLogDetailsToList(log, callsign, QString("Using model: ICAO '%1', livery '%2', model '%3', type '%4'"). CMatchingUtils::addLogDetailsToList(log, callsign, QString("Using model: ICAO '%1', livery '%2', model '%3', type '%4'").
arg(model.getAircraftIcaoCode().getCombinedIcaoStringWithKey(), arg(model.getAircraftIcaoCode().getCombinedIcaoStringWithKey(),
model.getLivery().getCombinedCodePlusInfo(), model.getLivery().getCombinedCodePlusInfo(),
model.getModelString(), model.getModelTypeAsString()) model.getModelString(), model.getModelTypeAsString()));
);
} }
return model; return model;
} }
@@ -852,16 +852,16 @@ namespace BlackCore
{ {
str += '\n'; str += '\n';
} }
str += QString::number(c); str += QString::number(c) %
str += ": score: "; QLatin1String(": score: ") %
str += QString::number(i.key()); QString::number(i.key()) %
str += " model: '"; QLatin1String(" model: '") %
str += m.getModelString(); m.getModelString() %
str += "' aircraft: '"; QLatin1String("' aircraft: '") %
str += m.getAircraftIcaoCodeDesignator(); m.getAircraftIcaoCodeDesignator() %
str += "' livery: '"; QLatin1String("' livery: '") %
str += m.getLivery().getCombinedCodePlusInfo(); m.getLivery().getCombinedCodePlusInfo() %
str += "'"; QLatin1Char('\'');
} }
return str; return str;
} }

View File

@@ -116,7 +116,7 @@ namespace BlackMisc
int score = 0; int score = 0;
if (this->hasValidDesignator() && this->getDesignator() == otherCode.getDesignator()) if (this->hasValidDesignator() && this->getDesignator() == otherCode.getDesignator())
{ {
score += 50; score += 50; // same designator
if (this->getRank() == 0) { score += 15; } if (this->getRank() == 0) { score += 15; }
else if (this->getRank() == 1) { score += 12; } else if (this->getRank() == 1) { score += 12; }

View File

@@ -251,7 +251,7 @@ namespace BlackMisc
//! As a brief HTML summary (e.g. used in tooltips) //! As a brief HTML summary (e.g. used in tooltips)
QString asHtmlSummary() const; QString asHtmlSummary() const;
//! Considers rank, manufacturer and family 0..90 //! Considers rank, manufacturer and family 0..100
//! \remark normally used with a selected set of ICAO codes or combined types //! \remark normally used with a selected set of ICAO codes or combined types
int calculateScore(const CAircraftIcaoCode &otherCode) const; int calculateScore(const CAircraftIcaoCode &otherCode) const;

View File

@@ -405,7 +405,7 @@ namespace BlackMisc
if (score == 0) { return 0; } if (score == 0) { return 0; }
if (this->isAirlineStandardLivery() && !preferColorLiveries) { score += 10; } if (this->isAirlineStandardLivery() && !preferColorLiveries) { score += 10; }
// overrate non airline liveries // overrate non airline liveries / color liveries
if (preferColorLiveries) if (preferColorLiveries)
{ {
if (this->isColorLivery() || !this->hasValidAirlineDesignator()) if (this->isColorLivery() || !this->hasValidAirlineDesignator())

View File

@@ -126,7 +126,7 @@ namespace BlackMisc
QString CAircraftModel::asHtmlSummary(const QString &separator) const QString CAircraftModel::asHtmlSummary(const QString &separator) const
{ {
const QString html = "Model: %1%2Aircraft ICAO: %3%4Livery: %5"; static const QString html = "Model: %1%2Aircraft ICAO: %3%4Livery: %5";
return html.arg(this->getModelStringAndDbKey(), separator, return html.arg(this->getModelStringAndDbKey(), separator,
this->getAircraftIcaoCode().asHtmlSummary(), separator, this->getAircraftIcaoCode().asHtmlSummary(), separator,
this->getLivery().asHtmlSummary()); this->getLivery().asHtmlSummary());