mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
Improved VATSIM datafile parsing
* removed empty split value at end * some formatting * columns to lower case at 1st parsing, not always
This commit is contained in:
@@ -97,11 +97,11 @@ namespace BlackMisc
|
||||
static QThreadStorage<QRegularExpression> tsRegex;
|
||||
if (! tsRegex.hasLocalData()) { tsRegex.setLocalData(QRegularExpression("(-\\s*|\\s)([A-Z]{4})$")); }
|
||||
const auto ®ex = tsRegex.localData();
|
||||
QRegularExpressionMatch match = regex.match(rn);
|
||||
const QRegularExpressionMatch match = regex.match(rn);
|
||||
if (match.hasMatch())
|
||||
{
|
||||
int pos = match.capturedStart(0);
|
||||
QString icao = match.captured(0).trimmed().right(4);
|
||||
const int pos = match.capturedStart(0);
|
||||
const QString icao = match.captured(0).trimmed().right(4);
|
||||
rn = rn.leftRef(pos).trimmed().toString();
|
||||
this->setHomeBase(CAirportIcaoCode(icao));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user