From e8c2690bfc92274b96d1620829977bf4c1db908b Mon Sep 17 00:00:00 2001 From: Mathias Gumz Date: Wed, 30 Sep 2009 21:03:59 +0200 Subject: cosmetic: slightly less code to do the same --- src/Resources.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Resources.cc b/src/Resources.cc index df0f926..20786d8 100644 --- a/src/Resources.cc +++ b/src/Resources.cc @@ -76,18 +76,20 @@ setFromString(char const *strval) { //clear old values m_value.clear(); + std::string v; for (size_t i = 0; i < val.size(); i++) { - if (strcasecmp(val[i].c_str(), "Maximize")==0) + v = FbTk::StringUtil::toLower(val[i]); + if (v == "maximize") m_value.push_back(WinButton::MAXIMIZE); - else if (strcasecmp(val[i].c_str(), "Minimize")==0) + else if (v == "minimize") m_value.push_back(WinButton::MINIMIZE); - else if (strcasecmp(val[i].c_str(), "Shade")==0) + else if (v == "shade") m_value.push_back(WinButton::SHADE); - else if (strcasecmp(val[i].c_str(), "Stick")==0) + else if (v == "stick") m_value.push_back(WinButton::STICK); - else if (strcasecmp(val[i].c_str(), "MenuIcon")==0) + else if (v == "menuIcon") m_value.push_back(WinButton::MENUICON); - else if (strcasecmp(val[i].c_str(), "Close")==0) + else if (v == "close") m_value.push_back(WinButton::CLOSE); } } -- cgit v0.11.2