diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index c38d58934..bdb93ad9d 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -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); diff --git a/gui/resultstree.cpp b/gui/resultstree.cpp index 5d1068962..7532352ec 100644 --- a/gui/resultstree.cpp +++ b/gui/resultstree.cpp @@ -778,3 +778,8 @@ bool ResultsTree::HasVisibleResults() const { return mVisibleErrors; } + +bool ResultsTree::HasResults() const +{ + return mModel.rowCount() > 0; +} diff --git a/gui/resultstree.h b/gui/resultstree.h index c77e071a3..21975e4d4 100644 --- a/gui/resultstree.h +++ b/gui/resultstree.h @@ -100,6 +100,12 @@ public: */ 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 diff --git a/gui/resultsview.cpp b/gui/resultsview.cpp index 5160b9718..a08ae6f9a 100644 --- a/gui/resultsview.cpp +++ b/gui/resultsview.cpp @@ -170,3 +170,8 @@ bool ResultsView::HasVisibleResults() const { return mTree->HasVisibleResults(); } + +bool ResultsView::HasResults() const +{ + return mTree->HasResults(); +} diff --git a/gui/resultsview.h b/gui/resultsview.h index 7bbcb7ce0..1dd27be7f 100644 --- a/gui/resultsview.h +++ b/gui/resultsview.h @@ -97,6 +97,13 @@ public: */ 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: /**