diff options
Diffstat (limited to 'Swift/QtUI')
-rw-r--r-- | Swift/QtUI/QtSettingsProvider.cpp | 5 | ||||
-rw-r--r-- | Swift/QtUI/QtSettingsProvider.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/Swift/QtUI/QtSettingsProvider.cpp b/Swift/QtUI/QtSettingsProvider.cpp index 0c4d49b..64e88d4 100644 --- a/Swift/QtUI/QtSettingsProvider.cpp +++ b/Swift/QtUI/QtSettingsProvider.cpp @@ -18,6 +18,11 @@ QtSettingsProvider::~QtSettingsProvider() { } +bool QtSettingsProvider::hasSetting(const std::string& key) { + return !settings_.value(key.c_str()).isNull(); +} + + std::string QtSettingsProvider::getSetting(const Setting<std::string>& setting) { QVariant variant = settings_.value(setting.getKey().c_str()); return variant.isNull() ? setting.getDefaultValue() : std::string(variant.toString().toUtf8()); diff --git a/Swift/QtUI/QtSettingsProvider.h b/Swift/QtUI/QtSettingsProvider.h index ececa6e..e85bfb5 100644 --- a/Swift/QtUI/QtSettingsProvider.h +++ b/Swift/QtUI/QtSettingsProvider.h @@ -25,6 +25,7 @@ class QtSettingsProvider : public SettingsProvider { virtual std::vector<std::string> getAvailableProfiles(); virtual void createProfile(const std::string& profile); virtual void removeProfile(const std::string& profile); + virtual bool hasSetting(const std::string& key); QSettings* getQSettings(); protected: virtual bool getIsSettingFinal(const std::string& settingPath); |