diff options
Diffstat (limited to 'src/FbTk/Theme.cc')
-rw-r--r-- | src/FbTk/Theme.cc | 12 |
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 | ||
108 | bool ThemeManager::unregisterTheme(Theme &tm) { | 110 | bool ThemeManager::unregisterTheme(Theme &tm) { |