diff --git a/isettings.cpp b/isettings.cpp index cabc089..ddba866 100644 --- a/isettings.cpp +++ b/isettings.cpp @@ -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); } diff --git a/isettings.h b/isettings.h index 85b16e5..855f58d 100644 --- a/isettings.h +++ b/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.