Ref T472, completer displays category

This commit is contained in:
Klaus Basan
2019-03-10 02:08:34 +01:00
committed by Mat Sutcliffe
parent 3a10483379
commit 0b29894bd8
3 changed files with 26 additions and 25 deletions

View File

@@ -517,7 +517,17 @@ namespace BlackMisc
return (this->hasDesignator() ? this->getDesignator() : QStringLiteral("????")) %
(this->hasManufacturer() ? (u' ' % this->getManufacturer()) : QString()) %
(this->hasModelDescription() ? (u' ' % this->getModelDescription()) : QString()) %
this->getDbKeyAsStringInParentheses(" ");
(this->getDbKeyAsStringInParentheses(" "));
}
QString CAircraftIcaoCode::getCombinedIcaoCategoryStringWithKey() const
{
if (!this->hasCategory()) { return this->getCombinedIcaoStringWithKey(); }
return (this->hasDesignator() ? this->getDesignator() : QStringLiteral("????")) %
(this->hasManufacturer() ? (u' ' % this->getManufacturer()) : QString()) %
(u" [" % this->getCategory().getNameDbKey() % ']') %
(this->hasModelDescription() ? (u' ' % this->getModelDescription()) : QString()) %
(this->getDbKeyAsStringInParentheses(" "));
}
QString CAircraftIcaoCode::getCombinedIataStringWithKey() const
@@ -527,7 +537,7 @@ namespace BlackMisc
(this->hasDesignator() ? (u' ' % this->getDesignator()) : QString()) %
(this->hasManufacturer() ? (u' ' % this->getManufacturer()) : QString()) %
(this->hasModelDescription() ? (u' ' % this->getModelDescription()) : QString()) %
this->getDbKeyAsStringInParentheses(" ");
(this->getDbKeyAsStringInParentheses(" "));
}
QString CAircraftIcaoCode::getCombinedFamilyStringWithKey() const
@@ -537,7 +547,7 @@ namespace BlackMisc
(this->hasDesignator() ? (u' ' % this->getDesignator()) : QString()) %
(this->hasManufacturer() ? (u' ' % this->getManufacturer()) : QString()) %
(this->hasModelDescription() ? (u' ' % this->getModelDescription()) : QString()) %
this->getDbKeyAsStringInParentheses(" ");
(this->getDbKeyAsStringInParentheses(" "));
}
bool CAircraftIcaoCode::hasCategory() const
@@ -559,7 +569,7 @@ namespace BlackMisc
{
const int r = fuzzyShortStringComparision(this->getDesignator(), d) >= fuzzyMatch;
if (result) { *result = r; }
return r >= fuzzyMatch;
return (r >= fuzzyMatch);
}
else
{
@@ -578,7 +588,7 @@ namespace BlackMisc
{
const int r = fuzzyShortStringComparision(this->getIataCode(), i) >= fuzzyMatch;
if (result) { *result = r; }
return r >= fuzzyMatch;
return (r >= fuzzyMatch);
}
else
{

View File

@@ -249,6 +249,9 @@ namespace BlackMisc
//! Combined ICAO descriptive string with key
QString getCombinedIcaoStringWithKey() const;
//! Combined ICAO descriptive string with category and key
QString getCombinedIcaoCategoryStringWithKey() const;
//! Combined IATA descriptive string with key
QString getCombinedIataStringWithKey() const;