summaryrefslogtreecommitdiff
path: root/src/plugins/python/pythonproject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/python/pythonproject.cpp')
-rw-r--r--src/plugins/python/pythonproject.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/plugins/python/pythonproject.cpp b/src/plugins/python/pythonproject.cpp
index 3c3b225de9..3b53292d8c 100644
--- a/src/plugins/python/pythonproject.cpp
+++ b/src/plugins/python/pythonproject.cpp
@@ -377,16 +377,17 @@ void PythonBuildSystem::parse()
*/
static void expandEnvironmentVariables(const QProcessEnvironment &env, QString &string)
{
- static QRegExp candidate(QLatin1String("\\$\\$\\((.+)\\)"));
+ const QRegularExpression candidate("\\$\\$\\((.+)\\)");
- int index = candidate.indexIn(string);
+ QRegularExpressionMatch match;
+ int index = string.indexOf(candidate, 0, &match);
while (index != -1) {
- const QString value = env.value(candidate.cap(1));
+ const QString value = env.value(match.captured(1));
- string.replace(index, candidate.matchedLength(), value);
+ string.replace(index, match.capturedLength(), value);
index += value.length();
- index = candidate.indexIn(string, index);
+ index = string.indexOf(candidate, index, &match);
}
}