Skip to content

Commit 4ad4f9d

Browse files
committed
Update existing code to avoid shadow argument warnings
1 parent 051f1ef commit 4ad4f9d

3 files changed

Lines changed: 15 additions & 15 deletions

File tree

gui/mainwindow.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ void MainWindow::saveSettings() const
566566
mUI->mResults->saveSettings(mSettings);
567567
}
568568

569-
void MainWindow::doAnalyzeProject(ImportProject p, const bool checkLibrary, const bool checkConfiguration)
569+
void MainWindow::doAnalyzeProject(ImportProject p, const bool doCheckLibrary, const bool doCheckConfiguration)
570570
{
571571
Settings checkSettings;
572572
auto supprs = std::make_shared<Suppressions>();
@@ -610,8 +610,8 @@ void MainWindow::doAnalyzeProject(ImportProject p, const bool checkLibrary, cons
610610

611611
mUI->mResults->setCheckDirectory(checkPath);
612612
checkSettings.force = false;
613-
checkSettings.checkLibrary = checkLibrary;
614-
checkSettings.checkConfiguration = checkConfiguration;
613+
checkSettings.checkLibrary = doCheckLibrary;
614+
checkSettings.checkConfiguration = doCheckConfiguration;
615615

616616
if (mProjectFile)
617617
qDebug() << "Checking project file" << mProjectFile->getFilename();
@@ -638,7 +638,7 @@ void MainWindow::doAnalyzeProject(ImportProject p, const bool checkLibrary, cons
638638
mUI->mResults->setCheckSettings(checkSettings);
639639
}
640640

641-
void MainWindow::doAnalyzeFiles(const QStringList &files, const bool checkLibrary, const bool checkConfiguration)
641+
void MainWindow::doAnalyzeFiles(const QStringList &files, const bool doCheckLibrary, const bool doCheckConfiguration)
642642
{
643643
if (files.isEmpty())
644644
return;
@@ -679,7 +679,7 @@ void MainWindow::doAnalyzeFiles(const QStringList &files, const bool checkLibrar
679679
// TODO: lock UI here?
680680
mUI->mResults->checkingStarted(fdetails.size());
681681
mThread->setFiles(std::move(fdetails));
682-
if (mProjectFile && !checkConfiguration)
682+
if (mProjectFile && !doCheckConfiguration)
683683
mThread->setAddonsAndTools(mProjectFile->getAddonsAndTools());
684684
mThread->setSuppressions(mProjectFile ? mProjectFile->getCheckingSuppressions() : QList<SuppressionList::Suppression>());
685685
QDir inf(mCurrentDirectory);
@@ -689,8 +689,8 @@ void MainWindow::doAnalyzeFiles(const QStringList &files, const bool checkLibrar
689689
checkLockDownUI(); // lock UI while checking
690690

691691
mUI->mResults->setCheckDirectory(checkPath);
692-
checkSettings.checkLibrary = checkLibrary;
693-
checkSettings.checkConfiguration = checkConfiguration;
692+
checkSettings.checkLibrary = doCheckLibrary;
693+
checkSettings.checkConfiguration = doCheckConfiguration;
694694

695695
if (mProjectFile)
696696
qDebug() << "Checking project file" << mProjectFile->getFilename();
@@ -1883,7 +1883,7 @@ bool MainWindow::loadLastResults()
18831883
return true;
18841884
}
18851885

1886-
void MainWindow::analyzeProject(const ProjectFile *projectFile, const QStringList& recheckFiles, const bool checkLibrary, const bool checkConfiguration)
1886+
void MainWindow::analyzeProject(const ProjectFile *projectFile, const QStringList& recheckFiles, const bool doCheckLibrary, const bool doCheckConfiguration)
18871887
{
18881888
Settings::terminate(false);
18891889

@@ -2011,7 +2011,7 @@ void MainWindow::analyzeProject(const ProjectFile *projectFile, const QStringLis
20112011
msg.exec();
20122012
return;
20132013
}
2014-
doAnalyzeProject(p, checkLibrary, checkConfiguration); // TODO: avoid copy
2014+
doAnalyzeProject(p, doCheckLibrary, doCheckConfiguration); // TODO: avoid copy
20152015
return;
20162016
}
20172017

@@ -2024,7 +2024,7 @@ void MainWindow::analyzeProject(const ProjectFile *projectFile, const QStringLis
20242024
if (paths.isEmpty()) {
20252025
paths << mCurrentDirectory;
20262026
}
2027-
doAnalyzeFiles(paths, checkLibrary, checkConfiguration);
2027+
doAnalyzeFiles(paths, doCheckLibrary, doCheckConfiguration);
20282028
}
20292029

20302030
void MainWindow::newProjectFile()

lib/filesettings.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ class FileWithDetails
9191
return mFsFileId;
9292
}
9393

94-
void setFsFileId(std::size_t fsFileId)
94+
void setFsFileId(std::size_t id)
9595
{
96-
mFsFileId = fsFileId;
96+
mFsFileId = id;
9797
}
9898
private:
9999
std::string mPath;

tools/triage/mainwindow.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,12 @@ void MainWindow::refreshResults()
181181
filter(ui->version->currentText());
182182
}
183183

184-
void MainWindow::filter(const QString& filter)
184+
void MainWindow::filter(const QString& filterStr)
185185
{
186186
QStringList allErrors;
187187

188188
for (const QString &errorItem : mAllErrors) {
189-
if (filter.isEmpty()) {
189+
if (filterStr.isEmpty()) {
190190
allErrors << errorItem;
191191
continue;
192192
}
@@ -195,7 +195,7 @@ void MainWindow::filter(const QString& filter)
195195
if (lines.size() < 2)
196196
continue;
197197

198-
if (lines[1].startsWith(filter))
198+
if (lines[1].startsWith(filterStr))
199199
allErrors << errorItem;
200200
}
201201

0 commit comments

Comments
 (0)