Android: Use QRegularExpression instead of QRegExp

Task-number: QTCREATORBUG-24098
Change-Id: Ic19bd73dd2bac39b393bf87c4567193631b57c80
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Stenger
2020-06-16 07:48:09 +02:00
parent 555970eeb0
commit 4b1adeca7f
5 changed files with 14 additions and 12 deletions

View File

@@ -42,6 +42,8 @@
#include <proparser/profileevaluator.h>
#include <QRegularExpression>
using namespace ProjectExplorer;
namespace Android {
@@ -168,10 +170,11 @@ void AndroidQtVersion::parseMkSpec(ProFileEvaluator *evaluator) const
m_androidAbis = QStringList{evaluator->value("ANDROID_TARGET_ARCH")};
const QString androidPlatform = evaluator->value("ANDROID_PLATFORM");
if (!androidPlatform.isEmpty()) {
const QRegExp regex("android-(\\d+)");
if (regex.exactMatch(androidPlatform)) {
const QRegularExpression regex("android-(\\d+)");
const QRegularExpressionMatch match = regex.match(androidPlatform);
if (match.hasMatch()) {
bool ok = false;
int tmp = regex.cap(1).toInt(&ok);
int tmp = match.captured(1).toInt(&ok);
if (ok)
m_minNdk = tmp;
}