@@ -1304,21 +1304,21 @@ void MainWindow::reAnalyzeModified()
13041304void MainWindow::reAnalyzeAll ()
13051305{
13061306 if (mProjectFile )
1307- analyzeProject (mProjectFile );
1307+ analyzeProject (mProjectFile , QStringList () );
13081308 else
13091309 reAnalyze (true );
13101310}
13111311
13121312void MainWindow::checkLibrary ()
13131313{
13141314 if (mProjectFile )
1315- analyzeProject (mProjectFile , true );
1315+ analyzeProject (mProjectFile , QStringList (), true );
13161316}
13171317
13181318void MainWindow::checkConfiguration ()
13191319{
13201320 if (mProjectFile )
1321- analyzeProject (mProjectFile , false , true );
1321+ analyzeProject (mProjectFile , QStringList (), false , true );
13221322}
13231323
13241324void MainWindow::reAnalyzeSelected (const QStringList& files)
@@ -1328,6 +1328,16 @@ void MainWindow::reAnalyzeSelected(const QStringList& files)
13281328 if (mThread ->isChecking ())
13291329 return ;
13301330
1331+ if (mProjectFile ) {
1332+ // Clear details, statistics and progress
1333+ mUI ->mResults ->clear (false );
1334+ for (int i = 0 ; i < files.size (); ++i)
1335+ mUI ->mResults ->clearRecheckFile (files[i]);
1336+
1337+ analyzeProject (mProjectFile , files);
1338+ return ;
1339+ }
1340+
13311341 const QPair<bool , Settings> checkSettingsPair = getCppcheckSettings ();
13321342 if (!checkSettingsPair.first )
13331343 return ;
@@ -1793,7 +1803,7 @@ void MainWindow::loadProjectFile(const QString &filePath)
17931803 mProjectFile = new ProjectFile (filePath, this );
17941804 mProjectFile ->setActiveProject ();
17951805 if (!loadLastResults ())
1796- analyzeProject (mProjectFile );
1806+ analyzeProject (mProjectFile , QStringList () );
17971807}
17981808
17991809QString MainWindow::getLastResults () const
@@ -1810,14 +1820,15 @@ bool MainWindow::loadLastResults()
18101820 return false ;
18111821 if (!QFileInfo::exists (lastResults))
18121822 return false ;
1823+ mUI ->mResults ->clear (true );
18131824 mUI ->mResults ->readErrorsXml (lastResults);
18141825 mUI ->mResults ->setCheckDirectory (mSettings ->value (SETTINGS_LAST_CHECK_PATH ,QString ()).toString ());
18151826 mUI ->mActionViewStats ->setEnabled (true );
18161827 enableResultsButtons ();
18171828 return true ;
18181829}
18191830
1820- void MainWindow::analyzeProject (const ProjectFile *projectFile, const bool checkLibrary, const bool checkConfiguration)
1831+ void MainWindow::analyzeProject (const ProjectFile *projectFile, const QStringList& recheckFiles, const bool checkLibrary, const bool checkConfiguration)
18211832{
18221833 Settings::terminate (false );
18231834
@@ -1919,7 +1930,7 @@ void MainWindow::analyzeProject(const ProjectFile *projectFile, const bool check
19191930 return ;
19201931 }
19211932
1922- QStringList paths = projectFile->getCheckPaths ();
1933+ QStringList paths = recheckFiles. isEmpty () ? projectFile->getCheckPaths () : recheckFiles ;
19231934
19241935 // If paths not given then check the root path (which may be the project
19251936 // file's location, see above). This is to keep the compatibility with
@@ -1960,7 +1971,7 @@ void MainWindow::newProjectFile()
19601971 ProjectFileDialog dlg (mProjectFile , isCppcheckPremium (), this );
19611972 if (dlg.exec () == QDialog::Accepted) {
19621973 addProjectMRU (filepath);
1963- analyzeProject (mProjectFile );
1974+ analyzeProject (mProjectFile , QStringList () );
19641975 } else {
19651976 closeProjectFile ();
19661977 }
@@ -1991,7 +2002,7 @@ void MainWindow::editProjectFile()
19912002 ProjectFileDialog dlg (mProjectFile , isCppcheckPremium (), this );
19922003 if (dlg.exec () == QDialog::Accepted) {
19932004 mProjectFile ->write ();
1994- analyzeProject (mProjectFile );
2005+ analyzeProject (mProjectFile , QStringList () );
19952006 }
19962007}
19972008
0 commit comments