Skip to content

Commit

Permalink
GUI: Enable clearing/saving results also if there are only hidden res…
Browse files Browse the repository at this point in the history
…ults.

This commit fixes a bug in my earlier commit that only checked visible results.
  • Loading branch information
kimmov committed Jun 20, 2009
1 parent bf84ab4 commit 2adfd36
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ QStringList MainWindow::RemoveUnacceptedFiles(const QStringList &list)
void MainWindow::CheckDone()
{
EnableCheckButtons(true);
if (mResults.HasVisibleResults())
if (mResults.HasResults())
{
mActionClearResults.setEnabled(true);
mActionSave.setEnabled(true);
Expand Down
5 changes: 5 additions & 0 deletions gui/resultstree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -778,3 +778,8 @@ bool ResultsTree::HasVisibleResults() const
{
return mVisibleErrors;
}

bool ResultsTree::HasResults() const
{
return mModel.rowCount() > 0;
}
6 changes: 6 additions & 0 deletions gui/resultstree.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ class ResultsTree : public QTreeView
*/
bool HasVisibleResults() const;

/**
* @brief Do we have results from check?
* @return true if there is at least one warning/error, hidden or visible.
*/
bool HasResults() const;

protected slots:
/**
* @brief Slot to quickstart an error with default application
Expand Down
5 changes: 5 additions & 0 deletions gui/resultsview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,8 @@ bool ResultsView::HasVisibleResults() const
{
return mTree->HasVisibleResults();
}

bool ResultsView::HasResults() const
{
return mTree->HasResults();
}
7 changes: 7 additions & 0 deletions gui/resultsview.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ class ResultsView : public QWidget
*/
bool HasVisibleResults() const;

/**
* @brief Do we have results from check?
*
* @return true if there is at least one warning/error, hidden or visible.
*/
bool HasResults() const;

signals:

/**
Expand Down

0 comments on commit 2adfd36

Please sign in to comment.