Workspace 6.21.5
|
#include <Authentication/Common/settingshelper.h>
Public Member Functions | |
SettingContainer (const QString &organisation, const QString &application, QSettings::Scope scope) | |
SettingContainer (const SettingContainer &)=delete | |
virtual | ~SettingContainer () |
void | add (const bool &defaultValue, const QString &key, const SettingItem< bool > &tag) |
void | add (const int &defaultValue, const QString &key, const SettingItem< int > &tag) |
void | add (const QString &defaultValue, const QString &key, const SettingItem< QString > &tag) |
void | addNested (const QString &key) |
SettingContainer & | getNested (const QString &key) |
QSettings::Scope | getScope () const |
bool | getValue (const SettingItem< bool > &tag, QPair< bool, bool > defaultValue=qMakePair(false, false)) const |
int | getValue (const SettingItem< int > &tag, QPair< bool, int > defaultValue=qMakePair(false, 0)) const |
QString | getValue (const SettingItem< QString > &tag, QPair< bool, QString > defaultValue=qMakePair(false, QString())) const |
void | inherit (const SettingItem< bool > &tag) |
void | inherit (const SettingItem< int > &tag) |
void | inherit (const SettingItem< QString > &tag) |
bool | isInherited (const SettingItem< bool > &tag) const |
bool | isInherited (const SettingItem< int > &tag) const |
bool | isInherited (const SettingItem< QString > &tag) const |
bool | isMissing (const SettingItem< bool > &tag) const |
bool | isMissing (const SettingItem< int > &tag) const |
bool | isMissing (const SettingItem< QString > &tag) const |
bool | isWritable () |
bool | load () |
bool | load (QSettings &settings) |
SettingContainer & | operator= (const SettingContainer &)=delete |
bool | save () const |
bool | save (QSettings &settings) const |
void | setValue (const SettingItem< bool > &tag, bool value) |
void | setValue (const SettingItem< int > &tag, int value) |
void | setValue (const SettingItem< QString > &tag, QString value) |
Manages settings.
SettingContainer | ( | const QString & | organisation, |
const QString & | application, | ||
QSettings::Scope | scope | ||
) |
|
delete |
|
virtualdefault |
Destructor.
void add | ( | const bool & | defaultValue, |
const QString & | key, | ||
const SettingItem< bool > & | tag | ||
) |
Add an item of bool type.
void add | ( | const int & | defaultValue, |
const QString & | key, | ||
const SettingItem< int > & | tag | ||
) |
Add an item of int type.
void add | ( | const QString & | defaultValue, |
const QString & | key, | ||
const SettingItem< QString > & | tag | ||
) |
Add an item of QString type.
void addNested | ( | const QString & | key | ) |
Add an item of nested SettingContainer.
SettingContainer & getNested | ( | const QString & | key | ) |
key | Name of the nested settings. |
Get (or create if not already exist) a nested SettingContainer named by key.
QSettings::Scope getScope | ( | ) | const |
Saves the settings to the settings store.
bool getValue | ( | const SettingItem< bool > & | tag, |
QPair< bool, bool > | defaultValue = qMakePair(false, false) |
||
) | const |
tag | Tag for the SettingsItem added earlier. |
defaultValue | A pair with its first true will return the default value by its second if the required settings is missing at the current scope. Otherwise, it uses the default values set by the add(). |
Get bool value by given tag. When missing, use the defaultValue specified.
int getValue | ( | const SettingItem< int > & | tag, |
QPair< bool, int > | defaultValue = qMakePair(false, 0) |
||
) | const |
tag | Tag for the SettingsItem added earlier. |
defaultValue | A pair with its first true will return the default value by its second if the required settings is missing at the current scope. Otherwise, it uses the default values set by the add(). |
Get int value by given tag. When missing, use the defaultValue specified.
QString getValue | ( | const SettingItem< QString > & | tag, |
QPair< bool, QString > | defaultValue = qMakePair(false, QString()) |
||
) | const |
tag | Tag for the SettingsItem added earlier. |
defaultValue | A pair with its first true will return the default value by its second if the required settings is missing at the current scope. Otherwise, it uses the default values set by the add(). |
Default value when required setting doesn't exist. Used when useDefaultOnParameter is true.
Get QString value by given tag. When missing, use the defaultValue specified.
void inherit | ( | const SettingItem< bool > & | tag | ) |
tag | Tag of the settings of interest. |
Mark the setting as inherit will remove it from the current user scope. When load it uses Qt's fallback mechanism to get the system scope value.
void inherit | ( | const SettingItem< int > & | tag | ) |
tag | Tag of the settings of interest. |
Mark the setting as inherit will remove it from the current user scope. When load it uses Qt's fallback mechanism to get the system scope value.
void inherit | ( | const SettingItem< QString > & | tag | ) |
tag | Tag of the settings of interest. |
Mark the setting as inherit will remove it from the current user scope. When load it uses Qt's fallback mechanism to get the system scope value.
bool isInherited | ( | const SettingItem< bool > & | tag | ) | const |
tag | Tag of the settings of interest. |
Query if the loaded setting inherited from different scope using Qt's fallback mechanism.
bool isInherited | ( | const SettingItem< int > & | tag | ) | const |
tag | Tag of the settings of interest. |
Query if the loaded setting inherited from different scope using Qt's fallback mechanism.
bool isInherited | ( | const SettingItem< QString > & | tag | ) | const |
tag | Tag of the settings of interest. |
Query if the loaded setting inherited from different scope using Qt's fallback mechanism.
bool isMissing | ( | const SettingItem< bool > & | tag | ) | const |
tag | Tag of the settings of interest. |
Query if the setting is missing from current scope.
bool isMissing | ( | const SettingItem< int > & | tag | ) | const |
tag | Tag of the settings of interest. |
Query if the setting is missing from current scope.
bool isMissing | ( | const SettingItem< QString > & | tag | ) | const |
tag | Tag of the settings of interest. |
Query if the setting is missing from current scope.
bool isWritable | ( | ) |
Indicates if the authenticated entity can be written or not.
bool load | ( | ) |
Loads the server settings from the settings area.
bool load | ( | QSettings & | settings | ) |
Loads the server settings from the settings area.
|
delete |
bool save | ( | ) | const |
Saves the settings to the settings store.
bool save | ( | QSettings & | settings | ) | const |
Saves the settings to the settings store.
void setValue | ( | const SettingItem< bool > & | tag, |
bool | value | ||
) |
tag | Tag for the SettingsItem added earlier. |
value | Value to set to the setting specified by tag. |
Set bool value on the setting specified by tag.
void setValue | ( | const SettingItem< int > & | tag, |
int | value | ||
) |
tag | Tag for the SettingsItem added earlier. |
value | Value to set to the setting specified by tag. |
Set int value on the setting specified by tag.
void setValue | ( | const SettingItem< QString > & | tag, |
QString | value | ||
) |
tag | Tag for the SettingsItem added earlier. |
value | Value to set to the setting specified by tag. |
Set QString value on the setting specified by tag.