summaryrefslogtreecommitdiff
path: root/src/configuration.cpp
diff options
context:
space:
mode:
authorChuck Miller <shadowmil@gmail.com>2010-11-13 17:00:46 -0500
committerChuck Miller <shadowmil@gmail.com>2010-11-13 17:39:15 -0500
commitf8d22e47ac3b6392d68f1a8a45383798f5751101 (patch)
treee29b42821ec8f6e579f2cfd4d2a20bc8c248b930 /src/configuration.cpp
parent8e7e63a2473eedd36eeef726e45dacc9d17d157a (diff)
downloadmana-f8d22e47ac3b6392d68f1a8a45383798f5751101.tar.gz
mana-f8d22e47ac3b6392d68f1a8a45383798f5751101.tar.bz2
mana-f8d22e47ac3b6392d68f1a8a45383798f5751101.tar.xz
mana-f8d22e47ac3b6392d68f1a8a45383798f5751101.zip
Replace config listeners with the event system
Reviewed-by: Jared Adams
Diffstat (limited to 'src/configuration.cpp')
-rw-r--r--src/configuration.cpp24
1 files changed, 4 insertions, 20 deletions
diff --git a/src/configuration.cpp b/src/configuration.cpp
index 50d76bfb..44fb6e2e 100644
--- a/src/configuration.cpp
+++ b/src/configuration.cpp
@@ -21,7 +21,7 @@
#include "configuration.h"
-#include "configlistener.h"
+#include "event.h"
#include "log.h"
#include "utils/stringutils.h"
@@ -38,13 +38,9 @@ void Configuration::setValue(const std::string &key, const std::string &value)
ConfigurationObject::setValue(key, value);
// Notify listeners
- ListenerMapIterator list = mListenerMap.find(key);
- if (list != mListenerMap.end())
- {
- Listeners listeners = list->second;
- for (ListenerIterator i = listeners.begin(); i != listeners.end(); i++)
- (*i)->optionChanged(key);
- }
+ Mana::Event event(EVENT_CONFIGOPTIONCHANGED);
+ event.setString("option", key);
+ event.trigger(CHANNEL_CONFIG);
}
std::string ConfigurationObject::getValue(const std::string &key,
@@ -358,15 +354,3 @@ void Configuration::write()
xmlTextWriterEndDocument(writer);
xmlFreeTextWriter(writer);
}
-
-void Configuration::addListener(const std::string &key,
- ConfigListener *listener)
-{
- mListenerMap[key].push_front(listener);
-}
-
-void Configuration::removeListener(const std::string &key,
- ConfigListener *listener)
-{
- mListenerMap[key].remove(listener);
-}