QtSupport: Convert to QRegularExpression

Change-Id: If9d407eb189c45ee81e6c73f37a93df6218c791a
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Tobias Hunger
2017-01-10 12:14:15 +01:00
committed by Tim Jenssen
parent ae0e15fad0
commit 3c41e2c09b

View File

@@ -55,7 +55,7 @@
#include <QFuture> #include <QFuture>
#include <QCoreApplication> #include <QCoreApplication>
#include <QProcess> #include <QProcess>
#include <QRegExp> #include <QRegularExpression>
using namespace Core; using namespace Core;
using namespace QtSupport; using namespace QtSupport;
@@ -1513,10 +1513,11 @@ FileName BaseQtVersion::mkspecFromVersionInfo(const QHash<QString, QString> &ver
if (temp.size() == 2) { if (temp.size() == 2) {
QString possibleFullPath = QString::fromLocal8Bit(temp.at(1).trimmed().constData()); QString possibleFullPath = QString::fromLocal8Bit(temp.at(1).trimmed().constData());
if (possibleFullPath.contains(QLatin1Char('$'))) { // QTBUG-28792 if (possibleFullPath.contains(QLatin1Char('$'))) { // QTBUG-28792
const QRegExp rex(QLatin1String("\\binclude\\(([^)]+)/qmake\\.conf\\)")); const QRegularExpression rex(QLatin1String("\\binclude\\(([^)]+)/qmake\\.conf\\)"));
if (rex.indexIn(QString::fromLocal8Bit(f2.readAll())) != -1) { const QRegularExpressionMatch match = rex.match(QString::fromLocal8Bit(f2.readAll()));
if (match.hasMatch()) {
possibleFullPath = mkspecFullPath.toString() + QLatin1Char('/') possibleFullPath = mkspecFullPath.toString() + QLatin1Char('/')
+ rex.cap(1); + match.captured(1);
} }
} }
// We sometimes get a mix of different slash styles here... // We sometimes get a mix of different slash styles here...