From f60a4699324bfe0f5c27009d10540c6ec5aafd59 Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Wed, 7 Jul 2010 12:25:47 +0300 Subject: [PATCH] Fixed #1831 (GUI: no progress bar when rechecking files) Need to initialize the checking also when rechecking. --- gui/mainwindow.cpp | 5 +++++ gui/threadhandler.cpp | 5 +++++ gui/threadhandler.h | 7 +++++++ 3 files changed, 17 insertions(+) diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 6da6335d0..15d4b08de 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -416,6 +416,11 @@ void MainWindow::ReCheck() { ClearResults(); EnableCheckButtons(false); + + const int filesCount = mThread->GetPreviousFilesCount(); + Q_ASSERT(filesCount > 0); // If no files should not be able to recheck + mUI.mResults->CheckingStarted(filesCount); + mThread->Check(GetCppcheckSettings(), true); } diff --git a/gui/threadhandler.cpp b/gui/threadhandler.cpp index 27c68963a..2dad5df0e 100644 --- a/gui/threadhandler.cpp +++ b/gui/threadhandler.cpp @@ -173,3 +173,8 @@ bool ThreadHandler::HasPreviousFiles() const return false; } + +int ThreadHandler::GetPreviousFilesCount() const +{ + return mLastFiles.size(); +} diff --git a/gui/threadhandler.h b/gui/threadhandler.h index bdb08b674..9f5b9a1e6 100644 --- a/gui/threadhandler.h +++ b/gui/threadhandler.h @@ -103,6 +103,13 @@ public: */ bool HasPreviousFiles() const; + /** + * @brief Return count of files we checked last time. + * + * @return count of files that were checked last time. + */ + int GetPreviousFilesCount() const; + signals: /** * @brief Signal that all threads are done