X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=util%2Fepist%2Fconfig.cc;h=461778e5f952958b8eb0ada2689f29729364a7ec;hb=97019b8b77f7e6450d87b057bcb6eae43e9f3e2b;hp=db9ecdddcf09aa174c8eff9ad4300891b4d0ddfc;hpb=11e643f4b885ee1f96112fcf531739a339691272;p=chaz%2Fopenbox diff --git a/util/epist/config.cc b/util/epist/config.cc index db9ecddd..461778e5 100644 --- a/util/epist/config.cc +++ b/util/epist/config.cc @@ -20,6 +20,10 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. +#ifdef HAVE_CONFIG_H +# include "../../config.h" +#endif // HAVE_CONFIG_H + #include "config.hh" using std::string; @@ -46,7 +50,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 +63,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 +76,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; } } @@ -93,6 +97,7 @@ void Config::addOption(const std::string &name, const std::string &value) } bool_options[] = { { "stackedcycling", Config::stackedCycling }, + { "stackedcyclingraise", Config::stackedCyclingRaise }, { "", NUM_BOOL_TYPES } }; @@ -123,7 +128,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;