diff options
author | Katja Marttila <katja.marttila@qt.io> | 2021-03-05 08:58:04 +0200 |
---|---|---|
committer | Katja Marttila <katja.marttila@qt.io> | 2021-03-09 13:23:44 +0200 |
commit | 6fdadf83710c37f70c1d2d621eacb9cbb327b23b (patch) | |
tree | 3b0aede467044c529fae34e6c3f5ac654ea9f974 /src/libs/ifwtools | |
parent | abd97626ac2d50e54650a7256b48b7bbc1b2769e (diff) |
Cppcheck: Fix local variable shadowing outer variable
Change-Id: Idff9a40c5089b4de7b8afd1c280603601317beda
Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
Diffstat (limited to 'src/libs/ifwtools')
-rw-r--r-- | src/libs/ifwtools/binarycreator.cpp | 10 | ||||
-rw-r--r-- | src/libs/ifwtools/repositorygen.cpp | 8 |
2 files changed, 9 insertions, 9 deletions
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> resource(new Resource(file)); - qDebug().nospace() << "Appending " << file << " (" << humanReadableSize(resource->size()) << ")"; + foreach (const QString &copiedFile, info.copiedFiles) { + const QSharedPointer<Resource> 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); } } |