Skip to content

Commit f60a469

Browse files
committed
Fixed danmar#1831 (GUI: no progress bar when rechecking files)
Need to initialize the checking also when rechecking.
1 parent a1793ed commit f60a469

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

gui/mainwindow.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,11 @@ void MainWindow::ReCheck()
416416
{
417417
ClearResults();
418418
EnableCheckButtons(false);
419+
420+
const int filesCount = mThread->GetPreviousFilesCount();
421+
Q_ASSERT(filesCount > 0); // If no files should not be able to recheck
422+
mUI.mResults->CheckingStarted(filesCount);
423+
419424
mThread->Check(GetCppcheckSettings(), true);
420425
}
421426

gui/threadhandler.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,8 @@ bool ThreadHandler::HasPreviousFiles() const
173173

174174
return false;
175175
}
176+
177+
int ThreadHandler::GetPreviousFilesCount() const
178+
{
179+
return mLastFiles.size();
180+
}

gui/threadhandler.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ class ThreadHandler : public QObject
103103
*/
104104
bool HasPreviousFiles() const;
105105

106+
/**
107+
* @brief Return count of files we checked last time.
108+
*
109+
* @return count of files that were checked last time.
110+
*/
111+
int GetPreviousFilesCount() const;
112+
106113
signals:
107114
/**
108115
* @brief Signal that all threads are done

0 commit comments

Comments
 (0)