Fixed calculation of statistics in GUI (#4578)
This commit is contained in:
parent
c5ee083c82
commit
107dd31e50
|
@ -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<QString, QVariant> data;
|
||||
|
@ -178,6 +178,7 @@ void ResultsTree::AddErrorItem(const ErrorItem &item)
|
|||
if (!hide) {
|
||||
ShowFileItem(realfile);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
QStandardItem *ResultsTree::AddBacktraceFiles(QStandardItem *parent,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue