aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils/qtcprocess.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/utils/qtcprocess.cpp')
-rw-r--r--src/libs/utils/qtcprocess.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libs/utils/qtcprocess.cpp b/src/libs/utils/qtcprocess.cpp
index 2088ae408f..9c6ea69b56 100644
--- a/src/libs/utils/qtcprocess.cpp
+++ b/src/libs/utils/qtcprocess.cpp
@@ -32,7 +32,7 @@
#include <QDir>
#include <QDebug>
#include <QCoreApplication>
-#include <QRegExp>
+#include <QRegularExpression>
#include <QStack>
#ifdef Q_OS_WIN
@@ -583,7 +583,7 @@ static QString quoteArgWin(const QString &arg)
// Quotes are escaped and their preceding backslashes are doubled.
// It's impossible to escape anything inside a quoted string on cmd
// level, so the outer quoting must be "suspended".
- ret.replace(QRegExp(QLatin1String("(\\\\*)\"")), QLatin1String("\"\\1\\1\\^\"\""));
+ ret.replace(QRegularExpression(QLatin1String("(\\\\*)\"")), QLatin1String("\"\\1\\1\\^\"\""));
// The argument must not end with a \ since this would be interpreted
// as escaping the quote -- rather put the \ behind the quote: e.g.
// rather use "foo"\ than "foo\"
@@ -626,7 +626,7 @@ void QtcProcess::addArg(QString *args, const QString &arg, OsType osType)
QString QtcProcess::joinArgs(const QStringList &args, OsType osType)
{
QString ret;
- foreach (const QString &arg, args)
+ for (const QString &arg : args)
addArg(&ret, arg, osType);
return ret;
}
@@ -642,7 +642,7 @@ void QtcProcess::addArgs(QString *args, const QString &inArgs)
void QtcProcess::addArgs(QString *args, const QStringList &inArgs)
{
- foreach (const QString &arg, inArgs)
+ for (const QString &arg : inArgs)
addArg(args, arg);
}
@@ -1062,7 +1062,7 @@ bool QtcProcess::expandMacros(QString *cmd, AbstractMacroExpander *mx, OsType os
// Our expansion rules trigger in any context
if (state.dquote) {
// We are within a double-quoted string. Escape relevant meta characters.
- rsts.replace(QRegExp(QLatin1String("([$`\"\\\\])")), QLatin1String("\\\\1"));
+ rsts.replace(QRegularExpression(QLatin1String("([$`\"\\\\])")), QLatin1String("\\\\1"));
} else if (state.current == MxSingleQuote) {
// We are within a single-quoted string. "Suspend" single-quoting and put a
// single escaped quote for each single quote inside the string.