mirror of
https://github.com/QuasarApp/QuasarAppLib.git
synced 2025-04-26 09:44:38 +00:00
ref # Added new method and fix logic
This commit is contained in:
parent
0c04d41712
commit
53d5cd4ff2
@ -25,6 +25,10 @@ void ISettings::setMode(const SettingsSaveMode &mode) {
|
||||
_mode = mode;
|
||||
}
|
||||
|
||||
const ISettings *ISettings::instance(){
|
||||
return _settings;
|
||||
}
|
||||
|
||||
QVariant ISettings::getValue(const QString &key, const QVariant &def) {
|
||||
return getValueImplementation(key, def);
|
||||
}
|
||||
|
10
isettings.h
10
isettings.h
@ -37,11 +37,11 @@ class QUASARAPPSHARED_EXPORT ISettings : public QObject
|
||||
public:
|
||||
|
||||
/**
|
||||
* @brief instance This method return instance of the settings object
|
||||
* @brief init This method return instance of the settings object
|
||||
* @return pointer to a settings object;
|
||||
*/
|
||||
template <class SettingsType, class... Args>
|
||||
static ISettings* instance(Args&&... args) {
|
||||
static ISettings* init(Args&&... args) {
|
||||
static_assert (std::is_base_of<ISettings, SettingsType>::value,
|
||||
"the Settingstype type must be ISettings");
|
||||
|
||||
@ -52,6 +52,12 @@ public:
|
||||
return _settings;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief instance
|
||||
* @return
|
||||
*/
|
||||
static const ISettings* instance();
|
||||
|
||||
/**
|
||||
* @brief getValue This method return the value of the settings.
|
||||
* @param key This is name of the required settings value.
|
||||
|
Loading…
x
Reference in New Issue
Block a user