diff --git a/gui/resultstree.cpp b/gui/resultstree.cpp index 968475342..b61f5e1bb 100644 --- a/gui/resultstree.cpp +++ b/gui/resultstree.cpp @@ -109,7 +109,7 @@ void ResultsTree::AddErrorItem(const ErrorItem &item) realfile = tr("Undefined file"); } - bool hide = !mShowTypes[SeverityToShowType(GuiSeverity::toString(item.severity))]; + bool hide = !mShowTypes[SeverityToShowType(item.severity)]; //if there is at least one error that is not hidden, we have a visible error if (!hide) @@ -137,7 +137,7 @@ void ResultsTree::AddErrorItem(const ErrorItem &item) //Add user data to that item QMap data; data["hide"] = false; - data["severity"] = SeverityToShowType(GuiSeverity::toString(item.severity)); + data["severity"] = SeverityToShowType(item.severity); data["summary"] = item.summary; data["message"] = item.message; data["file"] = item.files[0]; @@ -158,7 +158,7 @@ void ResultsTree::AddErrorItem(const ErrorItem &item) //Add user data to that item QMap child_data; - child_data["severity"] = SeverityToShowType(GuiSeverity::toString(line.severity)); + child_data["severity"] = SeverityToShowType(line.severity); child_data["summary"] = line.summary; child_data["message"] = line.message; child_data["file"] = item.files[i]; @@ -252,19 +252,19 @@ ShowTypes ResultsTree::VariantToShowType(const QVariant &data) return (ShowTypes)value; } -ShowTypes ResultsTree::SeverityToShowType(const QString & severity) +ShowTypes ResultsTree::SeverityToShowType(Severity::SeverityType severity) { - if (severity == "error") + if (severity == Severity::error) return SHOW_ERRORS; - if (severity == "style") + if (severity == Severity::style) return SHOW_STYLE; - if (severity == "warning") + if (severity == Severity::warning) return SHOW_WARNINGS; - if (severity == "performance") + if (severity == Severity::performance) return SHOW_PERFORMANCE; - if (severity == "portability") + if (severity == Severity::portability) return SHOW_PORTABILITY; - if (severity == "information") + if (severity == Severity::information) return SHOW_INFORMATION; return SHOW_NONE; diff --git a/gui/resultstree.h b/gui/resultstree.h index 99448261e..652e13435 100644 --- a/gui/resultstree.h +++ b/gui/resultstree.h @@ -28,6 +28,7 @@ #include #include "common.h" #include "applicationlist.h" +#include "errorlogger.h" // Severity class Report; class ErrorItem; @@ -128,10 +129,10 @@ public: /** * @brief Convert severity string to ShowTypes value - * @param severity Error severity string + * @param severity Error severity * @return Severity converted to ShowTypes value */ - static ShowTypes SeverityToShowType(const QString &severity); + static ShowTypes SeverityToShowType(Severity::SeverityType severity); signals: /** diff --git a/gui/resultsview.cpp b/gui/resultsview.cpp index 13bf85348..1d4f90568 100644 --- a/gui/resultsview.cpp +++ b/gui/resultsview.cpp @@ -88,7 +88,7 @@ void ResultsView::Error(const ErrorItem &item) mErrorsFound = true; mUI.mTree->AddErrorItem(item); emit GotResults(); - mStatistics->AddItem(ResultsTree::SeverityToShowType(GuiSeverity::toString(item.severity))); + mStatistics->AddItem(ResultsTree::SeverityToShowType(item.severity)); } void ResultsView::ShowResults(ShowTypes type, bool show)