diff options
Diffstat (limited to 'src/plugins/python/pythonproject.cpp')
-rw-r--r-- | src/plugins/python/pythonproject.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/plugins/python/pythonproject.cpp b/src/plugins/python/pythonproject.cpp index d74bedea0e..3b53292d8c 100644 --- a/src/plugins/python/pythonproject.cpp +++ b/src/plugins/python/pythonproject.cpp @@ -257,12 +257,12 @@ bool PythonBuildSystem::saveRawList(const QStringList &rawList, const QString &f FileSaver saver(fileName, QIODevice::ReadOnly | QIODevice::Text); if (!saver.hasError()) { QString content = QTextStream(saver.file()).readAll(); - if (saver.finalize(ICore::mainWindow())) { + if (saver.finalize(ICore::dialogParent())) { QString errorMessage; result = writePyProjectFile(fileName, content, rawList, &errorMessage); if (!errorMessage.isEmpty()) MessageManager::write(errorMessage); - } + } } } else { // Old project file FileSaver saver(fileName, QIODevice::WriteOnly | QIODevice::Text); @@ -271,7 +271,7 @@ bool PythonBuildSystem::saveRawList(const QStringList &rawList, const QString &f for (const QString &filePath : rawList) stream << filePath << '\n'; saver.setResult(&stream); - result = saver.finalize(ICore::mainWindow()); + result = saver.finalize(ICore::dialogParent()); } } @@ -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); } } |