summaryrefslogtreecommitdiffstats
path: root/qmake/generators/mac
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-04-03 17:11:36 +0200
committerLars Knoll <lars.knoll@qt.io>2020-05-05 18:41:27 +0200
commita1947aeffe158a0ea7de3ced1bf8d6a4719a27ef (patch)
treec1b249b7d8bd9b3079df3ad5fe468f7ff4df861b /qmake/generators/mac
parent412dd857b81471277e1014b6329f46a389a42cb3 (diff)
Port qmake over to user QRegularExpression
Use the DotMatchesEverythingOption for all places where we interpret .pro files, to increase compatibility with QRegExp. Change-Id: I347d6b17858069f3c9cedcedd04df58358d83f27 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'qmake/generators/mac')
-rw-r--r--qmake/generators/mac/pbuilder_pbx.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp
index ec0a044361..c6aab40d85 100644
--- a/qmake/generators/mac/pbuilder_pbx.cpp
+++ b/qmake/generators/mac/pbuilder_pbx.cpp
@@ -30,7 +30,7 @@
#include "option.h"
#include "meta.h"
#include <qdir.h>
-#include <qregexp.h>
+#include <qregularexpression.h>
#include <qcryptographichash.h>
#include <qdebug.h>
#include <qsettings.h>
@@ -1865,11 +1865,12 @@ QString
ProjectBuilderMakefileGenerator::fixForOutput(const QString &values)
{
//get the environment variables references
- QRegExp reg_var("\\$\\((.*)\\)");
- for(int rep = 0; (rep = reg_var.indexIn(values, rep)) != -1;) {
- if(project->values("QMAKE_PBX_VARS").indexOf(reg_var.cap(1)) == -1)
- project->values("QMAKE_PBX_VARS").append(reg_var.cap(1));
- rep += reg_var.matchedLength();
+ QRegularExpression reg_var("\\$\\((.*)\\)");
+ QRegularExpressionMatch match;
+ for (int rep = 0; (match = reg_var.match(values, rep)).hasMatch();) {
+ if (project->values("QMAKE_PBX_VARS").indexOf(match.captured(1)) == -1)
+ project->values("QMAKE_PBX_VARS").append(match.captured(1));
+ rep = match.capturedEnd();
}
return values;
@@ -2019,7 +2020,7 @@ ProjectBuilderMakefileGenerator::writeSettings(const QString &var, const ProStri
for(int i = 0; i < indent_level; ++i)
newline += "\t";
- static QRegExp allowedVariableCharacters("^[a-zA-Z0-9_]*$");
+ static QRegularExpression allowedVariableCharacters("^[a-zA-Z0-9_]*$");
ret += var.contains(allowedVariableCharacters) ? var : quotedStringLiteral(var);
ret += " = ";