ref # Added new method and fix logic

This commit is contained in:
IgorekLoschinin 2021-11-18 00:26:44 +03:00
parent 0c04d41712
commit 53d5cd4ff2
2 changed files with 12 additions and 2 deletions

View File

@ -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);
}

View File

@ -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.