From a6fc9a5812a3a864735ddc2c304fc85c6b6c1d1f Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 14 Mar 2019 08:11:31 +0100 Subject: [PATCH] Python: De-macrofy Change-Id: I5a0b2406d1ba8ad3a168c2635cbaec9711c4474f Reviewed-by: Cristian Maureira-Fredes --- src/plugins/pythoneditor/pythoneditorplugin.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/pythoneditor/pythoneditorplugin.cpp b/src/plugins/pythoneditor/pythoneditorplugin.cpp index dd722283e92..0d86d65a817 100644 --- a/src/plugins/pythoneditor/pythoneditorplugin.cpp +++ b/src/plugins/pythoneditor/pythoneditorplugin.cpp @@ -334,7 +334,7 @@ static QStringList readLines(const Utils::FileName &projectFile) if (file.open(QFile::ReadOnly)) { QTextStream stream(&file); - forever { + while (true) { QString line = stream.readLine(); if (line.isNull()) break; @@ -465,7 +465,7 @@ bool PythonProject::addFiles(const QStringList &filePaths) QStringList newList = m_rawFileList; QDir baseDir(projectDirectory().toString()); - foreach (const QString &filePath, filePaths) + for (const QString &filePath : filePaths) newList.append(baseDir.relativeFilePath(filePath)); return saveRawFileList(newList); @@ -475,7 +475,7 @@ bool PythonProject::removeFiles(const QStringList &filePaths) { QStringList newList = m_rawFileList; - foreach (const QString &filePath, filePaths) { + for (const QString &filePath : filePaths) { QHash::iterator i = m_rawListEntries.find(filePath); if (i != m_rawListEntries.end()) newList.removeOne(i.value()); @@ -488,7 +488,7 @@ bool PythonProject::setFiles(const QStringList &filePaths) { QStringList newList; QDir baseDir(projectDirectory().toString()); - foreach (const QString &filePath, filePaths) + for (const QString &filePath : filePaths) newList.append(baseDir.relativeFilePath(filePath)); return saveRawFileList(newList); @@ -611,7 +611,7 @@ QStringList PythonProject::processEntries(const QStringList &paths, QFileInfo fileInfo; QStringList absolutePaths; - foreach (const QString &path, paths) { + for (const QString &path : paths) { QString trimmedPath = path.trimmed(); if (trimmedPath.isEmpty()) continue; @@ -659,7 +659,7 @@ QHash sortFilesIntoPaths(const QString &base, const QSet filesInPath; const QDir baseDir(base); - foreach (const QString &absoluteFileName, files) { + for (const QString &absoluteFileName : files) { QFileInfo fileInfo(absoluteFileName); FileName absoluteFilePath = FileName::fromString(fileInfo.path()); QString relativeFilePath;