diff options
author | louis <louis.braun@gmx.de> | 2013-10-27 16:17:24 +0100 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2013-10-27 16:17:24 +0100 |
commit | 3cdbc204e283f45bfd71ea6adacd3693e83c1255 (patch) | |
tree | 344faf3a7d1240bf825b7a5c698d7e0f460354fb /config.c | |
parent | eec77c1ec540282b30891aeede497045b97070b6 (diff) | |
download | skin-nopacity-3cdbc204e283f45bfd71ea6adacd3693e83c1255.tar.gz skin-nopacity-3cdbc204e283f45bfd71ea6adacd3693e83c1255.tar.bz2 |
Fixed a bug in theme specific configs
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 28 |
1 files changed, 16 insertions, 12 deletions
@@ -341,24 +341,28 @@ bool cNopacityConfig::SetupParse(const char *Name, const char *Value) { std::map<std::string, int>::iterator hit = conf.find(name); if (hit == conf.end()) return false; - //check if theme already in map - std::map<std::string, std::map<std::string, int> >::iterator hit2 = themeConfigSetup.find(theme); - if (hit2 != themeConfigSetup.end()) { - std::map<std::string, int> existingValues = (std::map<std::string, int>)hit2->second; - existingValues.insert(std::pair<std::string, int>(name, atoi(Value))); - themeConfigSetup.erase(theme); - themeConfigSetup.insert(std::pair<std::string, std::map<std::string, int> >(theme, existingValues)); - } else { - std::map<std::string, int> themeConf; - themeConf.insert(std::pair<std::string, int>(name, atoi(Value))); - themeConfigSetup.insert(std::pair<std::string, std::map<std::string, int> >(theme, themeConf)); - } + SetThemeConfigSetupValue(theme, name, atoi(Value)); } else { return false; } return true; } +void cNopacityConfig::SetThemeConfigSetupValue(std::string themeName, std::string key, int value) { + //check if theme already in map + std::map<std::string, std::map<std::string, int> >::iterator hit = themeConfigSetup.find(themeName); + if (hit != themeConfigSetup.end()) { + std::map<std::string, int> existingValues = (std::map<std::string, int>)hit->second; + existingValues.insert(std::pair<std::string, int>(key, value)); + themeConfigSetup.erase(themeName); + themeConfigSetup.insert(std::pair<std::string, std::map<std::string, int> >(themeName, existingValues)); + } else { + std::map<std::string, int> themeConf; + themeConf.insert(std::pair<std::string, int>(key, value)); + themeConfigSetup.insert(std::pair<std::string, std::map<std::string, int> >(themeName, themeConf)); + } +} + void cNopacityConfig::DumpConfig(void) { esyslog("nopacity: current config -----------------"); for(std::map<std::string, int>::const_iterator it = conf.begin(); it != conf.end(); it++) { |