diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-04-03 17:11:36 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-05-05 18:41:27 +0200 |
commit | a1947aeffe158a0ea7de3ced1bf8d6a4719a27ef (patch) | |
tree | c1b249b7d8bd9b3079df3ad5fe468f7ff4df861b /qmake/main.cpp | |
parent | 412dd857b81471277e1014b6329f46a389a42cb3 (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/main.cpp')
-rw-r--r-- | qmake/main.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/qmake/main.cpp b/qmake/main.cpp index c0e6088d80..3cd79145e5 100644 --- a/qmake/main.cpp +++ b/qmake/main.cpp @@ -34,7 +34,7 @@ #include "metamakefile.h" #include <qnamespace.h> #include <qdebug.h> -#include <qregexp.h> +#include <qregularexpression.h> #include <qdir.h> #include <qdiriterator.h> #include <stdio.h> @@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE #ifdef Q_OS_WIN struct SedSubst { - QRegExp from; + QRegularExpression from; QString to; }; Q_DECLARE_TYPEINFO(SedSubst, Q_MOVABLE_TYPE); @@ -85,7 +85,7 @@ static int doSed(int argc, char **argv) return 3; } QChar sep = ++j < cmd.length() ? cmd.at(j) : QChar(); - Qt::CaseSensitivity matchcase = Qt::CaseSensitive; + QRegularExpression::PatternOptions matchcase = QRegularExpression::NoPatternOption; bool escaped = false; int phase = 1; QStringList phases; @@ -129,14 +129,14 @@ static int doSed(int argc, char **argv) } if (curr.contains(QLatin1Char('i'))) { curr.remove(QLatin1Char('i')); - matchcase = Qt::CaseInsensitive; + matchcase = QRegularExpression::CaseInsensitiveOption; } if (curr != QLatin1String("g")) { fprintf(stderr, "Error: sed s command supports only g & i options; g is required\n"); return 3; } SedSubst subst; - subst.from = QRegExp(phases.at(0), matchcase); + subst.from = QRegularExpression(phases.at(0), matchcase); subst.to = phases.at(1); subst.to.replace(QLatin1String("\\\\"), QLatin1String("\\")); // QString::replace(rx, sub) groks \1, but not \\. substs << subst; |