summaryrefslogtreecommitdiff
path: root/src/plugins/pythoneditor/pythoneditorplugin.cpp
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2019-03-27 19:19:25 +0100
committerEike Ziller <eike.ziller@qt.io>2019-03-28 08:48:21 +0000
commitae046702b0577d0fb2d9ade2a457e0ff10022f67 (patch)
tree4c527730acb198a63760bd5797cbc73be6e2ee89 /src/plugins/pythoneditor/pythoneditorplugin.cpp
parentfc078c30a2012affccfc087082401d9141c84b3c (diff)
downloadqt-creator-ae046702b0577d0fb2d9ade2a457e0ff10022f67.tar.gz
Fix detaches in for loop
Change-Id: I8d1de1435c7f53057611597b06d8c2af709563ec Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'src/plugins/pythoneditor/pythoneditorplugin.cpp')
-rw-r--r--src/plugins/pythoneditor/pythoneditorplugin.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/pythoneditor/pythoneditorplugin.cpp b/src/plugins/pythoneditor/pythoneditorplugin.cpp
index c8fbe192c7..f3efaedba5 100644
--- a/src/plugins/pythoneditor/pythoneditorplugin.cpp
+++ b/src/plugins/pythoneditor/pythoneditorplugin.cpp
@@ -381,8 +381,8 @@ static QStringList readLinesJson(const Utils::FileName &projectFile,
const QJsonObject obj = doc.object();
if (obj.contains("files")) {
- QJsonValue files = obj.value("files");
- QJsonArray files_array = files.toArray();
+ const QJsonValue files = obj.value("files");
+ const QJsonArray files_array = files.toArray();
QSet<QString> visited;
for (const auto &file : files_array)
visited.insert(file.toString());
@@ -512,7 +512,7 @@ void PythonProject::refresh(Target *target)
QDir baseDir(projectDirectory().toString());
BuildTargetInfoList appTargets;
auto newRoot = std::make_unique<PythonProjectNode>(this);
- for (const QString &f : m_files) {
+ for (const QString &f : qAsConst(m_files)) {
const QString displayName = baseDir.relativeFilePath(f);
FileType fileType = f.endsWith(".pyproject") || f.endsWith(".pyqtc") ? FileType::Project : FileType::Source;
newRoot->addNestedNode(std::make_unique<PythonFileNode>(FileName::fromString(f),