@@ -331,15 +331,15 @@ void MainWindow::loadSettings()
331331 mUI ->mActionToolBarFilter ->setChecked (showFilterToolbar);
332332 mUI ->mToolBarFilter ->setVisible (showFilterToolbar);
333333
334- Settings::Language enforcedLanguage = (Settings::Language)mSettings ->value (SETTINGS_ENFORCED_LANGUAGE, 0 ).toInt ();
334+ const Settings::Language enforcedLanguage = (Settings::Language)mSettings ->value (SETTINGS_ENFORCED_LANGUAGE, 0 ).toInt ();
335335 if (enforcedLanguage == Settings::CPP)
336336 mUI ->mActionEnforceCpp ->setChecked (true );
337337 else if (enforcedLanguage == Settings::C)
338338 mUI ->mActionEnforceC ->setChecked (true );
339339 else
340340 mUI ->mActionAutoDetectLanguage ->setChecked (true );
341341
342- bool succeeded = mApplications ->loadSettings ();
342+ const bool succeeded = mApplications ->loadSettings ();
343343 if (!succeeded) {
344344 const QString msg = tr (" There was a problem with loading the editor application settings.\n\n "
345345 " This is probably because the settings were changed between the Cppcheck versions. "
@@ -436,7 +436,7 @@ void MainWindow::doAnalyzeProject(ImportProject p, const bool checkLibrary, cons
436436 p.ignorePaths (v);
437437
438438 if (!mProjectFile ->getAnalyzeAllVsConfigs ()) {
439- Settings::PlatformType platform = (Settings::PlatformType) mSettings ->value (SETTINGS_CHECKED_PLATFORM, 0 ).toInt ();
439+ const Settings::PlatformType platform = (Settings::PlatformType) mSettings ->value (SETTINGS_CHECKED_PLATFORM, 0 ).toInt ();
440440 p.selectOneVsConfig (platform);
441441 }
442442 } else {
@@ -689,7 +689,7 @@ void MainWindow::analyzeDirectory()
689689 msgBox.addButton (QMessageBox::Yes);
690690 msgBox.addButton (QMessageBox::No);
691691 msgBox.setDefaultButton (QMessageBox::Yes);
692- int dlgResult = msgBox.exec ();
692+ const int dlgResult = msgBox.exec ();
693693 if (dlgResult == QMessageBox::Yes) {
694694 QString path = checkDir.canonicalPath ();
695695 if (!path.endsWith (" /" ))
@@ -712,7 +712,7 @@ void MainWindow::analyzeDirectory()
712712 msgBox.addButton (QMessageBox::Yes);
713713 msgBox.addButton (QMessageBox::No);
714714 msgBox.setDefaultButton (QMessageBox::Yes);
715- int dlgResult = msgBox.exec ();
715+ const int dlgResult = msgBox.exec ();
716716 if (dlgResult == QMessageBox::Yes) {
717717 doAnalyzeFiles (dir);
718718 }
@@ -1199,7 +1199,7 @@ void MainWindow::openResults()
11991199 msgBox.addButton (QMessageBox::Yes);
12001200 msgBox.addButton (QMessageBox::No);
12011201 msgBox.setDefaultButton (QMessageBox::Yes);
1202- int dlgResult = msgBox.exec ();
1202+ const int dlgResult = msgBox.exec ();
12031203 if (dlgResult == QMessageBox::No) {
12041204 return ;
12051205 }
@@ -1257,7 +1257,7 @@ void MainWindow::enableCheckButtons(bool enable)
12571257
12581258void MainWindow::enableResultsButtons ()
12591259{
1260- bool enabled = mUI ->mResults ->hasResults ();
1260+ const bool enabled = mUI ->mResults ->hasResults ();
12611261 mUI ->mActionClearResults ->setEnabled (enabled);
12621262 mUI ->mActionSave ->setEnabled (enabled);
12631263 mUI ->mActionPrint ->setEnabled (enabled);
@@ -1321,7 +1321,7 @@ void MainWindow::closeEvent(QCloseEvent *event)
13211321 this );
13221322
13231323 msg.setDefaultButton (QMessageBox::No);
1324- int rv = msg.exec ();
1324+ const int rv = msg.exec ();
13251325 if (rv == QMessageBox::Yes) {
13261326 // This isn't really very clean way to close threads but since the app is
13271327 // exiting it doesn't matter.
@@ -1781,7 +1781,7 @@ void MainWindow::openRecentProject()
17811781 this );
17821782
17831783 msg.setDefaultButton (QMessageBox::No);
1784- int rv = msg.exec ();
1784+ const int rv = msg.exec ();
17851785 if (rv == QMessageBox::Yes) {
17861786 removeProjectMRU (project);
17871787 }
0 commit comments