diff --git a/gui/resultstree.cpp b/gui/resultstree.cpp index 3155c5101..db89b0334 100644 --- a/gui/resultstree.cpp +++ b/gui/resultstree.cpp @@ -90,10 +90,10 @@ QStandardItem *ResultsTree::CreateLineNumberItem(const QString &linenumber) return item; } -void ResultsTree::AddErrorItem(const ErrorItem &item) +bool ResultsTree::AddErrorItem(const ErrorItem &item) { if (item.files.isEmpty()) { - return; + return false; } QString realfile = StripPath(item.files[0], false); @@ -136,7 +136,7 @@ void ResultsTree::AddErrorItem(const ErrorItem &item) SeverityToIcon(line.severity)); if (!stditem) - return; + return false; //Add user data to that item QMap data; @@ -178,6 +178,7 @@ void ResultsTree::AddErrorItem(const ErrorItem &item) if (!hide) { ShowFileItem(realfile); } + return true; } QStandardItem *ResultsTree::AddBacktraceFiles(QStandardItem *parent, diff --git a/gui/resultstree.h b/gui/resultstree.h index fb80b038c..04917338e 100644 --- a/gui/resultstree.h +++ b/gui/resultstree.h @@ -56,7 +56,7 @@ public: * * @param item Error item data */ - void AddErrorItem(const ErrorItem &item); + bool AddErrorItem(const ErrorItem &item); /** * @brief Clear all errors from the tree diff --git a/gui/resultsview.cpp b/gui/resultsview.cpp index dce3ff835..0c392a001 100644 --- a/gui/resultsview.cpp +++ b/gui/resultsview.cpp @@ -102,9 +102,10 @@ void ResultsView::Progress(int value, const QString& description) void ResultsView::Error(const ErrorItem &item) { mErrorsFound = true; - mUI.mTree->AddErrorItem(item); - emit GotResults(); - mStatistics->AddItem(ShowTypes::SeverityToShowType(item.severity)); + if (mUI.mTree->AddErrorItem(item)) { + emit GotResults(); + mStatistics->AddItem(ShowTypes::SeverityToShowType(item.severity)); + } } void ResultsView::ShowResults(ShowTypes::ShowType type, bool show)