aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/Theme.cc
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2007-12-16 08:50:59 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2007-12-16 08:50:59 (GMT)
commit4a7a143713c7febe7d3a7df9c044ed767b8bd3c6 (patch)
treef4d1f31c5167469f77408d42d6eca83a29d42b4c /src/FbTk/Theme.cc
parent8516f1e2a21a374127ccfa3f7b8de2443e67fe33 (diff)
downloadfluxbox-4a7a143713c7febe7d3a7df9c044ed767b8bd3c6.zip
fluxbox-4a7a143713c7febe7d3a7df9c044ed767b8bd3c6.tar.bz2
load style before loading theme objects, remove duplicate theme load
Diffstat (limited to 'src/FbTk/Theme.cc')
-rw-r--r--src/FbTk/Theme.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/FbTk/Theme.cc b/src/FbTk/Theme.cc
index cd03f5e..1c69bb4 100644
--- a/src/FbTk/Theme.cc
+++ b/src/FbTk/Theme.cc
@@ -97,12 +97,14 @@ bool ThemeManager::registerTheme(Theme &tm) {
97 // valid screen num? 97 // valid screen num?
98 if (m_max_screens < tm.screenNum() || tm.screenNum() < 0) 98 if (m_max_screens < tm.screenNum() || tm.screenNum() < 0)
99 return false; 99 return false;
100 // TODO: use find and return false if it's already there
101 // instead of unique
102 100
103 m_themes[tm.screenNum()].push_back(&tm); 101 ThemeList::const_iterator it = m_themes[tm.screenNum()].begin(),
104 m_themes[tm.screenNum()].unique(); 102 it_end = m_themes[tm.screenNum()].end();
105 return true; 103 if (std::find(it, it_end, &tm) == it_end) {
104 m_themes[tm.screenNum()].push_back(&tm);
105 return true;
106 }
107 return false;
106} 108}
107 109
108bool ThemeManager::unregisterTheme(Theme &tm) { 110bool ThemeManager::unregisterTheme(Theme &tm) {