]> Dogcows Code - chaz/openbox/blobdiff - util/epist/config.cc
fixed getStringValue failure case and compiler warnings
[chaz/openbox] / util / epist / config.cc
index a64d78d9bfe6ea3354ebc2c16e9a7e06afe1b1ad..506aab76f517ad4a7843b035c222e45dca25114c 100644 (file)
@@ -22,6 +22,8 @@
 
 #include "config.hh"
 
+using std::string;
+
 Config::Config() {}
 
 Config::~Config()
@@ -33,13 +35,16 @@ Config::~Config()
 }
 
 
-const string &Config::getStringValue(Config::ItemType type) const
+bool Config::getStringValue(Config::ItemType type, string &ret) const
 {
   ItemList::const_iterator it = items.begin(), end = items.end();
   for (; it != end; ++it) {
-    if ((*it)->getType() == type)
-      return (*it)->getStringValue();
+    if ((*it)->getType() == type) {
+      ret = (*it)->getStringValue();
+      return true;
+    }
   }
+  return false;
 }
 
 
@@ -50,7 +55,6 @@ int Config::getNumberValue(Config::ItemType type) const
     if ((*it)->getType() == type)
       return (*it)->getNumberValue();
   }
-
   return 0;
 }
 
This page took 0.020966 seconds and 4 git commands to generate.