summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2013-10-27 16:17:24 +0100
committerlouis <louis.braun@gmx.de>2013-10-27 16:17:24 +0100
commit3cdbc204e283f45bfd71ea6adacd3693e83c1255 (patch)
tree344faf3a7d1240bf825b7a5c698d7e0f460354fb /config.c
parenteec77c1ec540282b30891aeede497045b97070b6 (diff)
downloadskin-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.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/config.c b/config.c
index 9fa449a..f7d7e10 100644
--- a/config.c
+++ b/config.c
@@ -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++) {