Replace QRegExp with QRegularExpression

Reviewers: kbasan, msutcliffe

Reviewed By: kbasan, msutcliffe

Subscribers: jenkins

Differential Revision: https://dev.swift-project.org/D11
This commit is contained in:
Mathew Sutcliffe
2017-05-05 22:35:25 +01:00
parent 94fbfeefdb
commit d5ab73e1bc
17 changed files with 55 additions and 54 deletions

View File

@@ -49,7 +49,7 @@
#include <QJsonParseError>
#include <QJsonValue>
#include <QList>
#include <QRegExp>
#include <QRegularExpression>
#include <QTextCodec>
#include <QVector>
#include <Qt>
@@ -1062,7 +1062,7 @@ namespace BlackCore
{
// detect the stupid z1, z2, z3 placeholders
//! \fixme: Anything better as this stupid code here?
const QString test = fixed.toLower().remove(QRegExp("[\\n\\t\\r]"));
const QString test = fixed.toLower().remove(QRegularExpression("[\\n\\t\\r]"));
if (test == "z") return;
if (test.startsWith("z") && test.length() == 2) return; // z1, z2, ..
if (test.length() == 1) return; // sometimes just z
@@ -1088,8 +1088,8 @@ namespace BlackCore
}
auto cruiseAltString = cbvar_cast(cbvar)->fromFSD(fp->cruiseAltitude);
static const QRegExp withUnit("\\D+");
if (!cruiseAltString.isEmpty() && withUnit.indexIn(cruiseAltString) < 0)
thread_local const QRegularExpression withUnit("\\D+");
if (!cruiseAltString.isEmpty() && !withUnit.match(cruiseAltString).hasMatch())
{
cruiseAltString += "ft";
}