@@ -647,7 +647,7 @@ void MainWindow::doAnalyzeProject(ImportProject p, const bool checkLib, const bo
647647 mUI ->mResults ->setCheckSettings (checkSettings);
648648}
649649
650- void MainWindow::doAnalyzeFiles (const QStringList &files, const bool checkLib, const bool checkConfig)
650+ void MainWindow::doAnalyzeFiles (const QStringList &files, const bool checkLib, const bool checkConfig, const bool checkUnusedExcludes )
651651{
652652 if (files.isEmpty ())
653653 return ;
@@ -683,7 +683,7 @@ void MainWindow::doAnalyzeFiles(const QStringList &files, const bool checkLib, c
683683 return ;
684684 }
685685
686- const QStringList& unmatchedExcludePaths = pathList.getUnmatchedExcludes ();
686+ const QStringList& unmatchedExcludePaths = checkUnusedExcludes ? pathList.getUnmatchedExcludes () : QStringList ();
687687 if (!unmatchedExcludePaths.isEmpty ()) {
688688 QMessageBox msg (QMessageBox::Warning,
689689 " Cppcheck" ,
@@ -1992,7 +1992,9 @@ void MainWindow::analyzeProject(const ProjectFile *projectFile, const QStringLis
19921992 if (paths.isEmpty ()) {
19931993 paths << mCurrentDirectory ;
19941994 }
1995- doAnalyzeFiles (paths, checkLib, checkConfig);
1995+ // the exclude paths can only be validated when the whole project is analyzed
1996+ const bool checkUnusedExcludes = recheckFiles.isEmpty ();
1997+ doAnalyzeFiles (paths, checkLib, checkConfig, checkUnusedExcludes);
19961998}
19971999
19982000void MainWindow::newProjectFile ()
0 commit comments