From 3c41e2c09ba9fad3386a97de1f2008e8ad588dc7 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 10 Jan 2017 12:14:15 +0100 Subject: [PATCH] QtSupport: Convert to QRegularExpression Change-Id: If9d407eb189c45ee81e6c73f37a93df6218c791a Reviewed-by: Tim Jenssen --- src/plugins/qtsupport/baseqtversion.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index 459e07dd07d..6644a8d1349 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -55,7 +55,7 @@ #include #include #include -#include +#include using namespace Core; using namespace QtSupport; @@ -1513,10 +1513,11 @@ FileName BaseQtVersion::mkspecFromVersionInfo(const QHash &ver if (temp.size() == 2) { QString possibleFullPath = QString::fromLocal8Bit(temp.at(1).trimmed().constData()); if (possibleFullPath.contains(QLatin1Char('$'))) { // QTBUG-28792 - const QRegExp rex(QLatin1String("\\binclude\\(([^)]+)/qmake\\.conf\\)")); - if (rex.indexIn(QString::fromLocal8Bit(f2.readAll())) != -1) { + const QRegularExpression rex(QLatin1String("\\binclude\\(([^)]+)/qmake\\.conf\\)")); + const QRegularExpressionMatch match = rex.match(QString::fromLocal8Bit(f2.readAll())); + if (match.hasMatch()) { possibleFullPath = mkspecFullPath.toString() + QLatin1Char('/') - + rex.cap(1); + + match.captured(1); } } // We sometimes get a mix of different slash styles here...