diff options
author | Kevin Smith <git@kismith.co.uk> | 2012-03-01 08:03:50 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2012-03-03 09:00:30 (GMT) |
commit | fde71bd59b1412ae475c06f2d4100ce088e86af6 (patch) | |
tree | 4f3d85c700942d666c5ac5d032c757bc45bb1593 /Swift/Controllers/Settings/SettingsProvider.h | |
parent | 5271144cb6c0ecf3dc237af25197fa72a8737c09 (diff) | |
download | swift-contrib-fde71bd59b1412ae475c06f2d4100ce088e86af6.zip swift-contrib-fde71bd59b1412ae475c06f2d4100ce088e86af6.tar.bz2 |
Unit tests for SettingsProviderHierachy
Also fixing up errors they found and an uninitialised read left-over from the original patch.
Diffstat (limited to 'Swift/Controllers/Settings/SettingsProvider.h')
-rw-r--r-- | Swift/Controllers/Settings/SettingsProvider.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Swift/Controllers/Settings/SettingsProvider.h b/Swift/Controllers/Settings/SettingsProvider.h index e884add..458653b 100644 --- a/Swift/Controllers/Settings/SettingsProvider.h +++ b/Swift/Controllers/Settings/SettingsProvider.h @@ -23,51 +23,52 @@ class SettingsProvider { } const std::string& getKey() const { return key; } const T& getDefaultValue() const { return defaultValue; } private: std::string key; T defaultValue; }; public: virtual ~SettingsProvider() {} virtual std::string getSetting(const Setting<std::string>& setting) = 0; virtual void storeSetting(const Setting<std::string>& setting, const std::string& value) = 0; virtual bool getSetting(const Setting<bool>& setting) = 0; virtual void storeSetting(const Setting<bool>& setting, const bool& value) = 0; virtual int getSetting(const Setting<int>& setting) = 0; virtual void storeSetting(const Setting<int>& setting, const int& value) = 0; virtual std::vector<std::string> getAvailableProfiles() = 0; virtual void createProfile(const std::string& profile) = 0; virtual void removeProfile(const std::string& profile) = 0; /** A final setting is one that this settings provider says may not be overriden by lower priority profiles. * e.g. An Administrator-set configuration to disallow saving user passwords could not be overridden by the user. */ template<typename T> bool getIsSettingFinal(const Setting<T>& setting) { return getIsSettingFinal(setting.getKey()); } + virtual bool hasSetting(const std::string& key) = 0; friend class SettingsProviderHierachy; protected: virtual bool getIsSettingFinal(const std::string& settingPath) = 0; public: /** * Emitted when a setting is changed. */ boost::signal<void (const std::string& /*Setting's Path*/)> onSettingChanged; }; } |