From 6fdadf83710c37f70c1d2d621eacb9cbb327b23b Mon Sep 17 00:00:00 2001 From: Katja Marttila Date: Fri, 5 Mar 2021 08:58:04 +0200 Subject: Cppcheck: Fix local variable shadowing outer variable Change-Id: Idff9a40c5089b4de7b8afd1c280603601317beda Reviewed-by: Arttu Tarkiainen --- src/libs/ifwtools/binarycreator.cpp | 10 +++++----- src/libs/ifwtools/repositorygen.cpp | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/libs/ifwtools') diff --git a/src/libs/ifwtools/binarycreator.cpp b/src/libs/ifwtools/binarycreator.cpp index deea01ed7..a813c7f50 100644 --- a/src/libs/ifwtools/binarycreator.cpp +++ b/src/libs/ifwtools/binarycreator.cpp @@ -410,9 +410,9 @@ static int assemble(Input input, const QInstaller::Settings &settings, const QSt collection.setName(info.name.toUtf8()); qDebug() << "Creating resource archive for" << info.name; - foreach (const QString &file, info.copiedFiles) { - const QSharedPointer resource(new Resource(file)); - qDebug().nospace() << "Appending " << file << " (" << humanReadableSize(resource->size()) << ")"; + foreach (const QString &copiedFile, info.copiedFiles) { + const QSharedPointer resource(new Resource(copiedFile)); + qDebug().nospace() << "Appending " << copiedFile << " (" << humanReadableSize(resource->size()) << ")"; collection.appendResource(resource); } input.manager.insertCollection(collection); @@ -610,8 +610,8 @@ void QInstallerTools::copyConfigData(const QString &configFile, const QString &t if (tagName == QLatin1String("ProductImages")) { const QDomNodeList childNodes = domElement.childNodes(); - for (int i = 0; i < childNodes.count(); ++i) { - const QDomElement childElement = childNodes.at(i).toElement(); + for (int index = 0; index < childNodes.count(); ++index) { + const QDomElement childElement = childNodes.at(index).toElement(); const QString childName = childElement.tagName(); if (childName != QLatin1String("Image")) continue; diff --git a/src/libs/ifwtools/repositorygen.cpp b/src/libs/ifwtools/repositorygen.cpp index 842d4f9cb..863b5655b 100644 --- a/src/libs/ifwtools/repositorygen.cpp +++ b/src/libs/ifwtools/repositorygen.cpp @@ -777,14 +777,14 @@ QStringList QInstallerTools::unifyMetadata(const QString &repoDir, const QString QFile archiveFile(existingRepoDir); QInstaller::openForRead(&archiveFile); Lib7z::extractArchive(&archiveFile, existingRepoTemp); - QDir dir(existingRepoTemp); - QStringList existingRepoEntries = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot); + QDir dir2(existingRepoTemp); + QStringList existingRepoEntries = dir2.entryList(QDir::Dirs | QDir::NoDotAndDotDot); foreach (const QString existingRepoEntry, existingRepoEntries) { if (entryList.contains(existingRepoEntry)) { continue; } else { - dir.cd(existingRepoEntry); - const QString absPath = dir.absolutePath(); + dir2.cd(existingRepoEntry); + const QString absPath = dir2.absolutePath(); absPaths.append(absPath); } } -- cgit v1.2.3