Simplified some switch statements and removed redundant code (VS warning) in GUI.
This commit is contained in:
parent
d84d360afc
commit
60271a5819
|
@ -65,30 +65,22 @@ void CheckStatistics::Clear()
|
|||
|
||||
unsigned CheckStatistics::GetCount(ShowTypes::ShowType type) const
|
||||
{
|
||||
unsigned count = 0;
|
||||
switch (type) {
|
||||
case ShowTypes::ShowStyle:
|
||||
count = mStyle;
|
||||
break;
|
||||
return mStyle;
|
||||
case ShowTypes::ShowWarnings:
|
||||
count = mWarning;
|
||||
break;
|
||||
return mWarning;
|
||||
case ShowTypes::ShowPerformance:
|
||||
count = mPerformance;
|
||||
break;
|
||||
return mPerformance;
|
||||
case ShowTypes::ShowPortability:
|
||||
count = mPortability;
|
||||
break;
|
||||
return mPortability;
|
||||
case ShowTypes::ShowErrors:
|
||||
count = mError;
|
||||
break;
|
||||
return mError;
|
||||
case ShowTypes::ShowInformation:
|
||||
count = mInformation;
|
||||
break;
|
||||
return mInformation;
|
||||
case ShowTypes::ShowNone:
|
||||
default:
|
||||
qDebug() << "Unknown error type - returning zero statistics.";
|
||||
break;
|
||||
return 0;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
|
|
@ -51,8 +51,6 @@ ShowTypes::ShowType ShowTypes::SeverityToShowType(Severity::SeverityType severit
|
|||
default:
|
||||
return ShowTypes::ShowNone;
|
||||
}
|
||||
|
||||
return ShowTypes::ShowNone;
|
||||
}
|
||||
|
||||
Severity::SeverityType ShowTypes::ShowTypeToSeverity(ShowTypes::ShowType type)
|
||||
|
@ -60,34 +58,26 @@ Severity::SeverityType ShowTypes::ShowTypeToSeverity(ShowTypes::ShowType type)
|
|||
switch (type) {
|
||||
case ShowTypes::ShowStyle:
|
||||
return Severity::style;
|
||||
break;
|
||||
|
||||
case ShowTypes::ShowErrors:
|
||||
return Severity::error;
|
||||
break;
|
||||
|
||||
case ShowTypes::ShowWarnings:
|
||||
return Severity::warning;
|
||||
break;
|
||||
|
||||
case ShowTypes::ShowPerformance:
|
||||
return Severity::performance;
|
||||
break;
|
||||
|
||||
case ShowTypes::ShowPortability:
|
||||
return Severity::portability;
|
||||
break;
|
||||
|
||||
case ShowTypes::ShowInformation:
|
||||
return Severity::information;
|
||||
break;
|
||||
|
||||
case ShowTypes::ShowNone:
|
||||
default:
|
||||
return Severity::none;
|
||||
break;
|
||||
}
|
||||
|
||||
return Severity::none;
|
||||
}
|
||||
|
||||
ShowTypes::ShowType ShowTypes::VariantToShowType(const QVariant &data)
|
||||
|
|
Loading…
Reference in New Issue