-rw-r--r-- | inputmethods/dasher/SettingsStore.cpp | 5 | ||||
-rw-r--r-- | inputmethods/dasher/SettingsStore.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/inputmethods/dasher/SettingsStore.cpp b/inputmethods/dasher/SettingsStore.cpp index f7661bd..7e0fa58 100644 --- a/inputmethods/dasher/SettingsStore.cpp +++ b/inputmethods/dasher/SettingsStore.cpp | |||
@@ -7,24 +7,29 @@ | |||
7 | ///////////////////////////////////////////////////////////////////////////// | 7 | ///////////////////////////////////////////////////////////////////////////// |
8 | 8 | ||
9 | 9 | ||
10 | 10 | ||
11 | 11 | ||
12 | #include "SettingsStore.h" | 12 | #include "SettingsStore.h" |
13 | 13 | ||
14 | using namespace std; | 14 | using namespace std; |
15 | 15 | ||
16 | /* TODO: Consider using Template functions to make this neater. */ | 16 | /* TODO: Consider using Template functions to make this neater. */ |
17 | 17 | ||
18 | 18 | ||
19 | CSettingsStore::~CSettingsStore() | ||
20 | { | ||
21 | } | ||
22 | |||
23 | |||
19 | bool CSettingsStore::GetBoolOption(const string& Key) | 24 | bool CSettingsStore::GetBoolOption(const string& Key) |
20 | { | 25 | { |
21 | if (BoolMap.find(Key)==BoolMap.end()) { | 26 | if (BoolMap.find(Key)==BoolMap.end()) { |
22 | bool Value = false; | 27 | bool Value = false; |
23 | LoadSetting(Key, &Value); | 28 | LoadSetting(Key, &Value); |
24 | BoolMap[Key] = Value; | 29 | BoolMap[Key] = Value; |
25 | } | 30 | } |
26 | 31 | ||
27 | return BoolMap[Key]; | 32 | return BoolMap[Key]; |
28 | } | 33 | } |
29 | 34 | ||
30 | 35 | ||
diff --git a/inputmethods/dasher/SettingsStore.h b/inputmethods/dasher/SettingsStore.h index 8ef9fcf..2ddf152 100644 --- a/inputmethods/dasher/SettingsStore.h +++ b/inputmethods/dasher/SettingsStore.h | |||
@@ -18,24 +18,25 @@ | |||
18 | 18 | ||
19 | 19 | ||
20 | /* | 20 | /* |
21 | The public interface uses UTF-8 strings. All Keys should be | 21 | The public interface uses UTF-8 strings. All Keys should be |
22 | in American English and encodable in ASCII. However, | 22 | in American English and encodable in ASCII. However, |
23 | string Values may contain special characters where appropriate. | 23 | string Values may contain special characters where appropriate. |
24 | */ | 24 | */ |
25 | 25 | ||
26 | 26 | ||
27 | class CSettingsStore | 27 | class CSettingsStore |
28 | { | 28 | { |
29 | public: | 29 | public: |
30 | virtual ~CSettingsStore(); | ||
30 | bool GetBoolOption(const std::string& Key); | 31 | bool GetBoolOption(const std::string& Key); |
31 | long GetLongOption(const std::string& Key); | 32 | long GetLongOption(const std::string& Key); |
32 | std::string& GetStringOption(const std::string& Key); | 33 | std::string& GetStringOption(const std::string& Key); |
33 | 34 | ||
34 | void SetBoolOption(const std::string& Key, bool Value); | 35 | void SetBoolOption(const std::string& Key, bool Value); |
35 | void SetLongOption(const std::string& Key, long Value); | 36 | void SetLongOption(const std::string& Key, long Value); |
36 | void SetStringOption(const std::string& Key, const std::string& Value); | 37 | void SetStringOption(const std::string& Key, const std::string& Value); |
37 | 38 | ||
38 | void SetBoolDefault(const std::string& Key, bool Value); | 39 | void SetBoolDefault(const std::string& Key, bool Value); |
39 | void SetLongDefault(const std::string& Key, long Value); | 40 | void SetLongDefault(const std::string& Key, long Value); |
40 | void SetStringDefault(const std::string& Key, const std::string& Value); | 41 | void SetStringDefault(const std::string& Key, const std::string& Value); |
41 | private: | 42 | private: |