GUI: Add partial support for portability severity.

Add 'backend' support for the new 'portability' severity. The new
severity is handled, converted to new SHOW_PORTABILITY and added
with correct type to the result view.

There is no menuitem/toolbar button to show/hide portability
items. Likewise there is no line for portability issues in stats-
dialog.

Ticket #2106 (More severities and new xml format)
This commit is contained in:
Kimmo Varis 2010-12-13 11:25:45 +02:00
parent 48241c81f8
commit 9186cd8503
4 changed files with 15 additions and 0 deletions

View File

@ -39,6 +39,9 @@ void CheckStatistics::AddItem(ShowTypes type)
case SHOW_PERFORMANCE: case SHOW_PERFORMANCE:
mPerformance++; mPerformance++;
break; break;
case SHOW_PORTABILITY:
mPortability++;
break;
case SHOW_ERRORS: case SHOW_ERRORS:
mError++; mError++;
break; break;
@ -54,6 +57,7 @@ void CheckStatistics::Clear()
mStyle = 0; mStyle = 0;
mWarning = 0; mWarning = 0;
mPerformance = 0; mPerformance = 0;
mPortability = 0;
mError = 0; mError = 0;
} }
@ -71,6 +75,9 @@ unsigned CheckStatistics::GetCount(ShowTypes type) const
case SHOW_PERFORMANCE: case SHOW_PERFORMANCE:
count = mPerformance; count = mPerformance;
break; break;
case SHOW_PORTABILITY:
count = mPortability;
break;
case SHOW_ERRORS: case SHOW_ERRORS:
count = mError; count = mError;
break; break;

View File

@ -58,6 +58,7 @@ private:
unsigned mStyle; unsigned mStyle;
unsigned mWarning; unsigned mWarning;
unsigned mPerformance; unsigned mPerformance;
unsigned mPortability;
unsigned mError; unsigned mError;
}; };

View File

@ -32,6 +32,7 @@ typedef enum
SHOW_STYLE = 0, SHOW_STYLE = 0,
SHOW_WARNINGS, SHOW_WARNINGS,
SHOW_PERFORMANCE, SHOW_PERFORMANCE,
SHOW_PORTABILITY,
SHOW_ERRORS, // Keep this as last real item SHOW_ERRORS, // Keep this as last real item
SHOW_NONE SHOW_NONE
} }

View File

@ -260,6 +260,8 @@ ShowTypes ResultsTree::SeverityToShowType(const QString & severity)
return SHOW_WARNINGS; return SHOW_WARNINGS;
if (severity == "performance") if (severity == "performance")
return SHOW_PERFORMANCE; return SHOW_PERFORMANCE;
if (severity == "portability")
return SHOW_PORTABILITY;
return SHOW_NONE; return SHOW_NONE;
} }
@ -831,6 +833,10 @@ QString ResultsTree::ShowTypeToString(ShowTypes type)
return tr("performance"); return tr("performance");
break; break;
case SHOW_PORTABILITY:
return tr("portability");
break;
case SHOW_NONE: case SHOW_NONE:
return ""; return "";
break; break;