diff options
author | fluxgen <fluxgen> | 2003-12-19 17:08:25 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-12-19 17:08:25 (GMT) |
commit | ffc8cb9443d4ec44cd05c0cb82a27c597ef53888 (patch) | |
tree | 372ac82bfbf3c73eab5ac3d59e6261e0bcbdc544 /src/FbTk/Resource.cc | |
parent | bfd09dc88ceeda456f93bb85e1a328bb1e2e42e0 (diff) | |
download | fluxbox-ffc8cb9443d4ec44cd05c0cb82a27c597ef53888.zip fluxbox-ffc8cb9443d4ec44cd05c0cb82a27c597ef53888.tar.bz2 |
setResourceValue function and a dump
Diffstat (limited to 'src/FbTk/Resource.cc')
-rw-r--r-- | src/FbTk/Resource.cc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/FbTk/Resource.cc b/src/FbTk/Resource.cc index c21e55d..ad30b57 100644 --- a/src/FbTk/Resource.cc +++ b/src/FbTk/Resource.cc | |||
@@ -19,7 +19,7 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: Resource.cc,v 1.2 2003/07/18 15:40:55 rathnor Exp $ | 22 | // $Id: Resource.cc,v 1.3 2003/12/19 17:08:25 fluxgen Exp $ |
23 | 23 | ||
24 | #include "XrmDatabaseHelper.hh" | 24 | #include "XrmDatabaseHelper.hh" |
25 | #include "Resource.hh" | 25 | #include "Resource.hh" |
@@ -143,6 +143,19 @@ bool ResourceManager::save(const char *filename, const char *mergefilename) { | |||
143 | return true; | 143 | return true; |
144 | } | 144 | } |
145 | 145 | ||
146 | void ResourceManager::setResourceValue(const std::string &resname, const std::string &value) { | ||
147 | // find resource name | ||
148 | ResourceList::iterator i = m_resourcelist.begin(); | ||
149 | ResourceList::iterator i_end = m_resourcelist.end(); | ||
150 | for (; i != i_end; ++i) { | ||
151 | if ((*i)->name() == resname || | ||
152 | (*i)->altName() == resname) { | ||
153 | (*i)->setFromString(value.c_str()); | ||
154 | return; | ||
155 | } | ||
156 | } | ||
157 | } | ||
158 | |||
146 | void ResourceManager::ensureXrmIsInitialize() { | 159 | void ResourceManager::ensureXrmIsInitialize() { |
147 | if (!m_init) { | 160 | if (!m_init) { |
148 | XrmInitialize(); | 161 | XrmInitialize(); |