summaryrefslogtreecommitdiff
path: root/src/configuration.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-02-29 20:45:54 +0300
committerAndrei Karas <akaras@inbox.ru>2012-02-29 20:45:54 +0300
commit5b4160a49385bc6895681c5d103a4a5716829e4b (patch)
tree2b0119eef31a34b6345ce2b6f49ff8f0cfbca499 /src/configuration.cpp
parent085abf777701c8bdb3091084fe851b125e787ae1 (diff)
downloadplus-5b4160a49385bc6895681c5d103a4a5716829e4b.tar.gz
plus-5b4160a49385bc6895681c5d103a4a5716829e4b.tar.bz2
plus-5b4160a49385bc6895681c5d103a4a5716829e4b.tar.xz
plus-5b4160a49385bc6895681c5d103a4a5716829e4b.zip
Simplify remove listener calls.
Diffstat (limited to 'src/configuration.cpp')
-rw-r--r--src/configuration.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/configuration.cpp b/src/configuration.cpp
index 97540c385..624cf7865 100644
--- a/src/configuration.cpp
+++ b/src/configuration.cpp
@@ -617,14 +617,22 @@ void Configuration::write()
xmlFreeTextWriter(writer);
}
-void Configuration::addListener(
- const std::string &key, ConfigListener *listener)
+void Configuration::addListener(const std::string &key,
+ ConfigListener *listener)
{
mListenerMap[key].push_front(listener);
}
-void Configuration::removeListener(
- const std::string &key, ConfigListener *listener)
+void Configuration::removeListener(const std::string &key,
+ ConfigListener *listener)
{
mListenerMap[key].remove(listener);
}
+
+void Configuration::removeListeners(ConfigListener *listener)
+{
+ ListenerMapIterator it = mListenerMap.begin();
+ ListenerMapIterator it_end = mListenerMap.end();
+ for (; it != it_end; ++ it)
+ (it->second).remove(listener);
+}