all repos — fluxbox @ 8434c42aa8048d443306943ef48097dc8b31b79d

custom fork of the fluxbox windowmanager

const resourceValue function
fluxgen fluxgen
commit

8434c42aa8048d443306943ef48097dc8b31b79d

parent

37a435f1d7e694e32c74c65557558190cb2baf33

1 files changed, 14 insertions(+), 2 deletions(-)

jump to
M src/FbTk/Resource.ccsrc/FbTk/Resource.cc

@@ -161,8 +161,20 @@ }

return 0; } -string ResourceManager::resourceValue(const std::string &resname) { - Resource_base *res = findResource(resname); +const Resource_base *ResourceManager::findResource(const std::string &resname) const { + // find resource name + ResourceList::const_iterator i = m_resourcelist.begin(); + ResourceList::const_iterator i_end = m_resourcelist.end(); + for (; i != i_end; ++i) { + if ((*i)->name() == resname || + (*i)->altName() == resname) + return *i; + } + return 0; +} + +string ResourceManager::resourceValue(const std::string &resname) const { + const Resource_base *res = findResource(resname); if (res != 0) return res->getString();