diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-08-31 01:34:38 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-08-31 01:34:38 +0300 |
commit | e826d4c63365dde4c988453846437dcb65370945 (patch) | |
tree | 1bd23d4694c06d97e7e8c885253c0100fe6142b9 /src/configuration.h | |
parent | 75ca03c95c90064e67fa9eaddb4c609196dd3a27 (diff) | |
download | manaverse-e826d4c63365dde4c988453846437dcb65370945.tar.gz manaverse-e826d4c63365dde4c988453846437dcb65370945.tar.bz2 manaverse-e826d4c63365dde4c988453846437dcb65370945.tar.xz manaverse-e826d4c63365dde4c988453846437dcb65370945.zip |
Improve setting default values for configuration objects.
Diffstat (limited to 'src/configuration.h')
-rw-r--r-- | src/configuration.h | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/configuration.h b/src/configuration.h index 2556ac283..fa3e0ec19 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -255,14 +255,7 @@ class Configuration final : public ConfigurationObject void unload(); - /** - * Set the default values for each keys. - * - * @param defaultsData data used as defaults. - */ - void setDefaultValues(DefaultsData *const defaultsData); - - DefaultsData *getDefaultValues() + DefaultsData &getDefaultValues() { return mDefaultsData; } /** @@ -365,12 +358,12 @@ class Configuration final : public ConfigurationObject void writeUpdated(); - private: /** * Clean up the default values member. */ void cleanDefaults(); + private: typedef std::list<ConfigListener*> Listeners; typedef Listeners::iterator ListenerIterator; typedef std::map<std::string, Listeners> ListenerMap; @@ -380,7 +373,7 @@ class Configuration final : public ConfigurationObject // Location of config file std::string mConfigPath; /// Defaults of value for a given key - DefaultsData *mDefaultsData; + DefaultsData mDefaultsData; std::string mDirectory; std::string mFilename; UseVirtFs mUseResManager; |