]> Dogcows Code - chaz/openbox/blobdiff - util/epist/config.cc
Fixed a couple of glitches, added on/off values for boolean
[chaz/openbox] / util / epist / config.cc
index db9ecdddcf09aa174c8eff9ad4300891b4d0ddfc..f4f0bac6e6c49c19bf58215d95909ed6f7999c7f 100644 (file)
@@ -46,7 +46,7 @@ Config::~Config()
 }
 
 
-bool Config::getStringValue(Config::StringType type, string &ret) const
+bool Config::getValue(Config::StringType type, string &ret) const
 {
   StringItemList::const_iterator it = string_items.begin(), end = string_items.end();
   for (; it != end; ++it) {
@@ -59,7 +59,7 @@ bool Config::getStringValue(Config::StringType type, string &ret) const
 }
 
 
-bool Config::getNumberValue(Config::NumberType type, int &ret) const
+bool Config::getValue(Config::NumberType type, int &ret) const
 {
   NumberItemList::const_iterator it = number_items.begin(), end = number_items.end();
   for (; it != end; ++it) {
@@ -72,12 +72,12 @@ bool Config::getNumberValue(Config::NumberType type, int &ret) const
 }
 
 
-bool Config::getBoolValue(Config::BoolType type, bool &ret) const
+bool Config::getValue(Config::BoolType type, bool &ret) const
 {
   BoolItemList::const_iterator it = bool_items.begin(), end = bool_items.end();
   for (; it != end; ++it) {
     if ((*it)->type == type) {
-      ret = (*it)->type;
+      ret = (*it)->value;
       return true;
     }
   }
@@ -123,7 +123,8 @@ void Config::addOption(const std::string &name, const std::string &value)
 
       item->type = bool_options[i].type;
 
-      if (strcasecmp(tmp, "true") == 0 || strcasecmp(tmp, "1"))
+      if (strcasecmp(tmp, "true") == 0 || strcasecmp(tmp, "1") == 0 ||
+          strcasecmp(tmp, "on") == 0)
         item->value = true;
       else
         item->value = false;
This page took 0.026151 seconds and 4 git commands to generate.