From 14eede1cbafad9ffcd8d87288c5a3ee290be6a6b Mon Sep 17 00:00:00 2001 From: PKEuS Date: Sun, 21 Oct 2012 11:37:23 +0200 Subject: [PATCH] Show translated name of severities in ResultsTree. Removed redundant break; from switch, removed redundant return (MSVC warning) --- gui/resultstree.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/gui/resultstree.cpp b/gui/resultstree.cpp index cae4a1148..f3f76d990 100644 --- a/gui/resultstree.cpp +++ b/gui/resultstree.cpp @@ -195,8 +195,8 @@ QStandardItem *ResultsTree::AddBacktraceFiles(QStandardItem *parent, // Ensure shown path is with native separators const QString file = QDir::toNativeSeparators(item.file); list << CreateNormalItem(file); - const QString severity = GuiSeverity::toString(item.severity); - list << CreateNormalItem(severity.toLatin1()); + const QString severity = SeverityToTranslatedString(item.severity); + list << CreateNormalItem(severity); list << CreateLineNumberItem(QString("%1").arg(item.line)); //TODO message has parameter names so we'll need changes to the core //cppcheck so we can get proper translations @@ -253,38 +253,29 @@ QString ResultsTree::SeverityToTranslatedString(Severity::SeverityType severity) switch (severity) { case Severity::style: return tr("style"); - break; case Severity::error: return tr("error"); - break; case Severity::warning: return tr("warning"); - break; case Severity::performance: return tr("performance"); - break; case Severity::portability: return tr("portability"); - break; case Severity::information: return tr("information"); - break; case Severity::debug: return tr("debug"); - break; case Severity::none: + default: return ""; - break; } - - return ""; } QStandardItem *ResultsTree::FindFileItem(const QString &name) @@ -805,7 +796,6 @@ QString ResultsTree::SeverityToIcon(Severity::SeverityType severity) const default: return ""; } - return ""; } void ResultsTree::SaveResults(Report *report)