Permalink
Browse files

Tidy some preferences code

(cherry picked from commit 3d9e433)
  • Loading branch information...
peternewman committed Aug 17, 2018
1 parent 458a4e9 commit b62f49afe28001af3ae511fd9bcb816ec8dfd673
Showing with 5 additions and 5 deletions.
  1. +5 −5 olad/plugin_api/Preferences.cpp
@@ -306,8 +306,9 @@ string MemoryPreferences::GetValue(const string &key) const {
PreferencesMap::const_iterator iter;
iter = m_pref_map.find(key);

if (iter != m_pref_map.end())
if (iter != m_pref_map.end()) {
return iter->second;
}
return "";
}

@@ -338,16 +339,15 @@ bool MemoryPreferences::GetValueAsBool(const string &key) const {
PreferencesMap::const_iterator iter;
iter = m_pref_map.find(key);

if (iter != m_pref_map.end())
if (iter != m_pref_map.end()) {
return iter->second == BoolValidator::ENABLED;
}
return false;
}


void MemoryPreferences::SetValueAsBool(const string &key, bool value) {
m_pref_map.erase(key);
m_pref_map.insert(make_pair(key, (value ? BoolValidator::ENABLED :
BoolValidator::DISABLED)));
SetValue(key, (value ? BoolValidator::ENABLED : BoolValidator::DISABLED));
}


0 comments on commit b62f49a

Please sign in to comment.