refs #681, FSD UI at login screen

* plus completers for login GUI (ICAO, ...)
* some utility functions in related value object classed
This commit is contained in:
Klaus Basan
2016-06-28 21:23:16 +02:00
parent b4a9531357
commit 6f97e7290b
9 changed files with 244 additions and 114 deletions

View File

@@ -263,6 +263,18 @@ namespace BlackMisc
return (regexp.match(airline).hasMatch());
}
QString CAirlineIcaoCode::normalizeDesignator(const QString candidate)
{
QString n(candidate.trimmed().toUpper());
if (n.contains(' ')) { n = n.left(n.indexOf(' ')); } // cutoff as first space
if (n.isEmpty()) { return n; }
static QThreadStorage<QRegularExpression> tsRegex;
if (! tsRegex.hasLocalData()) { tsRegex.setLocalData(QRegularExpression("[^a-zA-Z\\d\\s]")); }
const QRegularExpression &regexp = tsRegex.localData();
return n.remove(regexp);
}
QString CAirlineIcaoCode::getCombinedStringWithKey() const
{
QString s(getVDesignator());