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;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResultsTree::AddErrorItem(const ErrorItem &item)
|
bool ResultsTree::AddErrorItem(const ErrorItem &item)
|
||||||
{
|
{
|
||||||
if (item.files.isEmpty()) {
|
if (item.files.isEmpty()) {
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString realfile = StripPath(item.files[0], false);
|
QString realfile = StripPath(item.files[0], false);
|
||||||
|
@ -136,7 +136,7 @@ void ResultsTree::AddErrorItem(const ErrorItem &item)
|
||||||
SeverityToIcon(line.severity));
|
SeverityToIcon(line.severity));
|
||||||
|
|
||||||
if (!stditem)
|
if (!stditem)
|
||||||
return;
|
return false;
|
||||||
|
|
||||||
//Add user data to that item
|
//Add user data to that item
|
||||||
QMap<QString, QVariant> data;
|
QMap<QString, QVariant> data;
|
||||||
|
@ -178,6 +178,7 @@ void ResultsTree::AddErrorItem(const ErrorItem &item)
|
||||||
if (!hide) {
|
if (!hide) {
|
||||||
ShowFileItem(realfile);
|
ShowFileItem(realfile);
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStandardItem *ResultsTree::AddBacktraceFiles(QStandardItem *parent,
|
QStandardItem *ResultsTree::AddBacktraceFiles(QStandardItem *parent,
|
||||||
|
|
|
@ -56,7 +56,7 @@ public:
|
||||||
*
|
*
|
||||||
* @param item Error item data
|
* @param item Error item data
|
||||||
*/
|
*/
|
||||||
void AddErrorItem(const ErrorItem &item);
|
bool AddErrorItem(const ErrorItem &item);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Clear all errors from the tree
|
* @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)
|
void ResultsView::Error(const ErrorItem &item)
|
||||||
{
|
{
|
||||||
mErrorsFound = true;
|
mErrorsFound = true;
|
||||||
mUI.mTree->AddErrorItem(item);
|
if (mUI.mTree->AddErrorItem(item)) {
|
||||||
emit GotResults();
|
emit GotResults();
|
||||||
mStatistics->AddItem(ShowTypes::SeverityToShowType(item.severity));
|
mStatistics->AddItem(ShowTypes::SeverityToShowType(item.severity));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResultsView::ShowResults(ShowTypes::ShowType type, bool show)
|
void ResultsView::ShowResults(ShowTypes::ShowType type, bool show)
|
||||||
|
|
Loading…
Reference in New Issue