Fix #455 (Recheck is enabled when no previous results available)

http://sourceforge.net/apps/trac/cppcheck/ticket/455
This commit is contained in:
Reijo Tomperi 2009-10-13 11:19:00 +03:00
parent be0c79f36c
commit 8e0f868a5e
3 changed files with 19 additions and 1 deletions

View File

@ -89,6 +89,7 @@ MainWindow::MainWindow() :
mUI.mActionClearResults->setEnabled(false); mUI.mActionClearResults->setEnabled(false);
mUI.mActionSave->setEnabled(false); mUI.mActionSave->setEnabled(false);
mUI.mActionRecheck->setEnabled(false);
@ -419,7 +420,10 @@ void MainWindow::EnableCheckButtons(bool enable)
{ {
mUI.mActionStop->setEnabled(!enable); mUI.mActionStop->setEnabled(!enable);
mUI.mActionCheckFiles->setEnabled(enable); mUI.mActionCheckFiles->setEnabled(enable);
mUI.mActionRecheck->setEnabled(enable);
if (!enable || mThread->HasPreviousFiles())
mUI.mActionRecheck->setEnabled(enable);
mUI.mActionCheckDirectory->setEnabled(enable); mUI.mActionCheckDirectory->setEnabled(enable);
} }

View File

@ -166,3 +166,10 @@ void ThreadHandler::SaveSettings(QSettings &settings)
settings.setValue(SETTINGS_CHECK_THREADS, mThreads.size()); settings.setValue(SETTINGS_CHECK_THREADS, mThreads.size());
} }
bool ThreadHandler::HasPreviousFiles() const
{
if (mLastFiles.size() > 0)
return true;
return false;
}

View File

@ -96,6 +96,13 @@ public:
*/ */
bool IsChecking() const; bool IsChecking() const;
/**
* @brief Have we checked files already?
*
* @return true check has been previously run and recheck can be done
*/
bool HasPreviousFiles() const;
signals: signals:
/** /**
* @brief Signal that all threads are done * @brief Signal that all threads are done