Cppcheck
|
A class for different show types we have. More...
#include <showtypes.h>
Public Types | |
enum | ShowType { ShowStyle = 0 , ShowWarnings , ShowPerformance , ShowPortability , ShowInformation , ShowErrors , ShowNone } |
Show types we have (i.e. More... | |
Public Member Functions | |
ShowTypes () | |
Constructor. More... | |
~ShowTypes () | |
Destructor. More... | |
void | load () |
Load visibility settings from the platform's settings storage. More... | |
void | save () const |
Save visibility settings to the platform's settings storage. More... | |
bool | isShown (ShowTypes::ShowType category) const |
Is the showtype visible in the GUI? More... | |
bool | isShown (Severity severity) const |
Is the severity visible in the GUI? More... | |
void | show (ShowTypes::ShowType category, bool showing) |
Show/hide the showtype. More... | |
Static Public Member Functions | |
static ShowTypes::ShowType | SeverityToShowType (Severity severity) |
Convert severity string to ShowTypes value. More... | |
static Severity | ShowTypeToSeverity (ShowTypes::ShowType type) |
Convert ShowType to severity string. More... | |
static ShowTypes::ShowType | VariantToShowType (const QVariant &data) |
Convert QVariant (that contains an int) to Showtypes value. More... | |
Public Attributes | |
bool | mVisible [ShowNone] |
A class for different show types we have.
This class contains enum type for the different show types we have. Each show type presents one severity selectable in the GUI. In addition there are several supporting functions.
Notice that the "visibility" settings are automatically loaded when the class is constructed and saved when the class is destroyed.
Definition at line 38 of file showtypes.h.
enum ShowTypes::ShowType |
Show types we have (i.e.
severities in the GUI).
Enumerator | |
---|---|
ShowStyle | |
ShowWarnings | |
ShowPerformance | |
ShowPortability | |
ShowInformation | |
ShowErrors | |
ShowNone |
Definition at line 44 of file showtypes.h.
ShowTypes::ShowTypes | ( | ) |
Constructor.
Definition at line 26 of file showtypes.cpp.
References load().
ShowTypes::~ShowTypes | ( | ) |
Destructor.
Definition at line 31 of file showtypes.cpp.
References save().
bool ShowTypes::isShown | ( | Severity | severity | ) | const |
Is the severity visible in the GUI?
severity | severity to check. |
Definition at line 122 of file showtypes.cpp.
References isShown(), and SeverityToShowType().
bool ShowTypes::isShown | ( | ShowTypes::ShowType | category | ) | const |
Is the showtype visible in the GUI?
category | Showtype to check. |
Definition at line 117 of file showtypes.cpp.
References mVisible.
Referenced by ResultsTree::addErrorItem(), isShown(), MainWindow::loadSettings(), ResultsTree::refreshTree(), and ResultsTree::showResults().
void ShowTypes::load | ( | ) |
Load visibility settings from the platform's settings storage.
Definition at line 95 of file showtypes.cpp.
References mVisible, SETTINGS_SHOW_ERRORS, SETTINGS_SHOW_INFORMATION, SETTINGS_SHOW_PERFORMANCE, SETTINGS_SHOW_PORTABILITY, SETTINGS_SHOW_STYLE, SETTINGS_SHOW_WARNINGS, ShowErrors, ShowInformation, ShowPerformance, ShowPortability, ShowStyle, and ShowWarnings.
Referenced by ShowTypes().
void ShowTypes::save | ( | ) | const |
Save visibility settings to the platform's settings storage.
Definition at line 106 of file showtypes.cpp.
References mVisible, SETTINGS_SHOW_ERRORS, SETTINGS_SHOW_INFORMATION, SETTINGS_SHOW_PERFORMANCE, SETTINGS_SHOW_PORTABILITY, SETTINGS_SHOW_STYLE, SETTINGS_SHOW_WARNINGS, ShowErrors, ShowInformation, ShowPerformance, ShowPortability, ShowStyle, and ShowWarnings.
Referenced by ~ShowTypes().
|
static |
Convert severity string to ShowTypes value.
severity | Error severity |
Definition at line 36 of file showtypes.cpp.
References error, information, internal, none, performance, portability, ShowErrors, ShowInformation, ShowNone, ShowPerformance, ShowPortability, ShowStyle, ShowWarnings, style, and warning.
Referenced by ResultsTree::addErrorItem(), ResultsView::error(), and isShown().
void ShowTypes::show | ( | ShowTypes::ShowType | category, |
bool | showing | ||
) |
Show/hide the showtype.
category | Showtype whose visibility to set. |
showing | true if the severity is set visible. |
Definition at line 127 of file showtypes.cpp.
References mVisible.
Referenced by ResultsTree::showResults().
|
static |
Convert ShowType to severity string.
type | ShowType to convert |
Definition at line 59 of file showtypes.cpp.
References error, information, none, performance, portability, ShowErrors, ShowInformation, ShowNone, ShowPerformance, ShowPortability, ShowStyle, ShowWarnings, style, and warning.
Referenced by ResultsTree::copy(), and ResultsTree::readErrorItem().
|
static |
Convert QVariant (that contains an int) to Showtypes value.
data | QVariant (that contains an int) to be converted |
Definition at line 86 of file showtypes.cpp.
References ShowErrors, and ShowNone.
Referenced by ResultsTree::readErrorItem(), and ResultsTree::refreshTree().
bool ShowTypes::mVisible[ShowNone] |