diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-05-18 18:49:27 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-05-18 18:49:27 +0300 |
commit | 25a143ac11baebc9ecaf5c2c05d4808f20d54e3c (patch) | |
tree | ab48fe5020a74aab2d3b6e73d0cf5b99c09307ac | |
parent | c7a122c9d12d4ba6c08aed06291ebebf6bcdd1ed (diff) | |
download | mv-25a143ac11baebc9ecaf5c2c05d4808f20d54e3c.tar.gz mv-25a143ac11baebc9ecaf5c2c05d4808f20d54e3c.tar.bz2 mv-25a143ac11baebc9ecaf5c2c05d4808f20d54e3c.tar.xz mv-25a143ac11baebc9ecaf5c2c05d4808f20d54e3c.zip |
rename listender to depricatedlistener.
-rw-r--r-- | src/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/Makefile.am | 4 | ||||
-rw-r--r-- | src/depricatedevent.cpp | 20 | ||||
-rw-r--r-- | src/depricatedevent.h | 16 | ||||
-rw-r--r-- | src/depricatedlistener.cpp (renamed from src/listener.cpp) | 8 | ||||
-rw-r--r-- | src/depricatedlistener.h (renamed from src/listener.h) | 8 | ||||
-rw-r--r-- | src/gui/chatwindow.h | 4 | ||||
-rw-r--r-- | src/gui/inventorywindow.h | 4 | ||||
-rw-r--r-- | src/gui/killstats.h | 4 | ||||
-rw-r--r-- | src/gui/ministatuswindow.h | 4 | ||||
-rw-r--r-- | src/gui/statuswindow.h | 4 | ||||
-rw-r--r-- | src/localplayer.h | 4 | ||||
-rw-r--r-- | src/net/eathena/generalhandler.h | 2 | ||||
-rw-r--r-- | src/net/tmwa/generalhandler.h | 2 | ||||
-rw-r--r-- | src/playerinfo.cpp | 2 |
15 files changed, 45 insertions, 45 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index faf54448f..a90dbc212 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -568,6 +568,8 @@ SET(SRCS defaults.h depricatedevent.cpp depricatedevent.h + depricatedlistener.cpp + depricatedlistener.h effectmanager.cpp effectmanager.h emoteshortcut.cpp @@ -617,8 +619,6 @@ SET(SRCS keyevent.h keyinput.cpp keyinput.h - listener.cpp - listener.h localconsts.h localplayer.cpp localplayer.h diff --git a/src/Makefile.am b/src/Makefile.am index 773d86761..afef46e1b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -571,6 +571,8 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \ defaults.h \ depricatedevent.cpp \ depricatedevent.h \ + depricatedlistener.cpp \ + depricatedlistener.h \ effectmanager.cpp \ effectmanager.h \ emoteshortcut.cpp \ @@ -620,8 +622,6 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \ keyevent.h \ keyinput.cpp \ keyinput.h \ - listener.cpp \ - listener.h \ localconsts.h \ localplayer.cpp \ localplayer.h \ diff --git a/src/depricatedevent.cpp b/src/depricatedevent.cpp index 11ea29311..b303db4dd 100644 --- a/src/depricatedevent.cpp +++ b/src/depricatedevent.cpp @@ -21,12 +21,12 @@ #include "depricatedevent.h" -#include "listener.h" +#include "depricatedlistener.h" #include "variabledata.h" #include "debug.h" -ListenMap DepricatedEvent::mBindings; +DepricatedListenMap DepricatedEvent::mBindings; DepricatedEvent::~DepricatedEvent() { @@ -107,15 +107,15 @@ double DepricatedEvent::getFloat(const std::string &key) const void DepricatedEvent::trigger(const Channels channel, const DepricatedEvent &event) { - const ListenMap::const_iterator it = mBindings.find(channel); + const DepricatedListenMap::const_iterator it = mBindings.find(channel); // Make sure something is listening if (it == mBindings.end()) return; // Loop though all listeners - ListenerSet::const_iterator lit = it->second.begin(); - const ListenerSet::const_iterator lit_end = it->second.end(); + DepricatedListenerSet::const_iterator lit = it->second.begin(); + const DepricatedListenerSet::const_iterator lit_end = it->second.end(); while (lit != lit_end) { if (*lit) @@ -124,9 +124,9 @@ void DepricatedEvent::trigger(const Channels channel, } } -void DepricatedEvent::remove(Listener *const listener) +void DepricatedEvent::remove(DepricatedListener *const listener) { - ListenMap::iterator it = mBindings.begin(); + DepricatedListenMap::iterator it = mBindings.begin(); while (it != mBindings.end()) { it->second.erase(listener); @@ -134,12 +134,14 @@ void DepricatedEvent::remove(Listener *const listener) } } -void DepricatedEvent::bind(Listener *const listener, const Channels channel) +void DepricatedEvent::bind(DepricatedListener *const listener, + const Channels channel) { mBindings[channel].insert(listener); } -void DepricatedEvent::unbind(Listener *const listener, const Channels channel) +void DepricatedEvent::unbind(DepricatedListener *const listener, + const Channels channel) { mBindings[channel].erase(listener); } diff --git a/src/depricatedevent.h b/src/depricatedevent.h index c142ec0b1..1c31cea57 100644 --- a/src/depricatedevent.h +++ b/src/depricatedevent.h @@ -39,12 +39,12 @@ enum DepricatedEvents EVENT_UPDATESTAT }; -class Listener; +class DepricatedListener; class VariableData; typedef std::map<std::string, VariableData *> VariableMap; -typedef std::set<Listener *> ListenerSet; -typedef std::map<Channels, ListenerSet > ListenMap; +typedef std::set<DepricatedListener *> DepricatedListenerSet; +typedef std::map<Channels, DepricatedListenerSet > DepricatedListenMap; class DepricatedEvent final { @@ -84,17 +84,19 @@ class DepricatedEvent final const DepricatedEvent &event); // Removes a listener from all channels - static void remove(Listener *const listener); + static void remove(DepricatedListener *const listener); // Adds or removes a listener to a channel. - static void bind(Listener *const listener, const Channels channel); + static void bind(DepricatedListener *const listener, + const Channels channel); - static void unbind(Listener *const listener, const Channels channel); + static void unbind(DepricatedListener *const listener, + const Channels channel); private: DepricatedEvents mDepricatedEventName; - static ListenMap mBindings; + static DepricatedListenMap mBindings; VariableMap mData; }; diff --git a/src/listener.cpp b/src/depricatedlistener.cpp index 137ff66ec..376a85d92 100644 --- a/src/listener.cpp +++ b/src/depricatedlistener.cpp @@ -19,21 +19,21 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "listener.h" +#include "depricatedlistener.h" #include "debug.h" -Listener::~Listener() +DepricatedListener::~DepricatedListener() { DepricatedEvent::remove(this); } -void Listener::listen(Channels channel) +void DepricatedListener::listen(Channels channel) { DepricatedEvent::bind(this, channel); } -void Listener::ignore(Channels channel) +void DepricatedListener::ignore(Channels channel) { DepricatedEvent::unbind(this, channel); } diff --git a/src/listener.h b/src/depricatedlistener.h index 263e1bf97..3914cac25 100644 --- a/src/listener.h +++ b/src/depricatedlistener.h @@ -19,17 +19,17 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef LISTENER_H -#define LISTENER_H +#ifndef DEPRICATEDLISTENER_H +#define DEPRICATEDLISTENER_H #include "depricatedevent.h" #include <string> -class Listener +class DepricatedListener { public: - virtual ~Listener(); + virtual ~DepricatedListener(); void listen(Channels channel); diff --git a/src/gui/chatwindow.h b/src/gui/chatwindow.h index 39ca8ede9..e0a60a82d 100644 --- a/src/gui/chatwindow.h +++ b/src/gui/chatwindow.h @@ -23,7 +23,7 @@ #ifndef CHATWINDOW_H #define CHATWINDOW_H -#include "listener.h" +#include "depricatedlistener.h" #include "configlistener.h" @@ -92,7 +92,7 @@ struct CHATLOG final class ChatWindow final : public Window, public gcn::ActionListener, public gcn::KeyListener, - public Listener, + public DepricatedListener, public ConfigListener { public: diff --git a/src/gui/inventorywindow.h b/src/gui/inventorywindow.h index 48c097f88..952eb2afc 100644 --- a/src/gui/inventorywindow.h +++ b/src/gui/inventorywindow.h @@ -24,7 +24,7 @@ #define INVENTORYWINDOW_H #include "inventory.h" -#include "listener.h" +#include "depricatedlistener.h" #include "gui/widgets/window.h" @@ -56,7 +56,7 @@ class InventoryWindow final : public Window, public gcn::KeyListener, public gcn::SelectionListener, public InventoryListener, - public Listener + public DepricatedListener { public: /** diff --git a/src/gui/killstats.h b/src/gui/killstats.h index f2aa19e81..78c793077 100644 --- a/src/gui/killstats.h +++ b/src/gui/killstats.h @@ -25,7 +25,7 @@ #include <guichan/actionlistener.hpp> -#include "listener.h" +#include "depricatedlistener.h" #include "gui/widgets/window.h" @@ -34,7 +34,7 @@ class Button; class KillStats final : public Window, private gcn::ActionListener, - public Listener + public DepricatedListener { public: /** diff --git a/src/gui/ministatuswindow.h b/src/gui/ministatuswindow.h index ea807f462..c95bb7602 100644 --- a/src/gui/ministatuswindow.h +++ b/src/gui/ministatuswindow.h @@ -24,7 +24,7 @@ #define MINISTATUSWINDOW_H #include "inventory.h" -#include "listener.h" +#include "depricatedlistener.h" #include "gui/widgets/popup.h" @@ -43,7 +43,7 @@ class TextPopup; */ class MiniStatusWindow final : public Popup, public InventoryListener, - public Listener + public DepricatedListener { public: MiniStatusWindow(); diff --git a/src/gui/statuswindow.h b/src/gui/statuswindow.h index 2c9e3d3f7..384c4f494 100644 --- a/src/gui/statuswindow.h +++ b/src/gui/statuswindow.h @@ -23,7 +23,7 @@ #ifndef STATUS_H #define STATUS_H -#include "listener.h" +#include "depricatedlistener.h" #include "gui/widgets/window.h" @@ -45,7 +45,7 @@ class VertContainer; */ class StatusWindow final : public Window, public gcn::ActionListener, - public Listener + public DepricatedListener { public: /** diff --git a/src/localplayer.h b/src/localplayer.h index eaa7cdb10..8f5a16367 100644 --- a/src/localplayer.h +++ b/src/localplayer.h @@ -25,7 +25,7 @@ #include "actorspritelistener.h" #include "being.h" -#include "listener.h" +#include "depricatedlistener.h" #include "localconsts.h" #include "gui/userpalette.h" @@ -68,7 +68,7 @@ enum */ class LocalPlayer final : public Being, public ActorSpriteListener, - public Listener + public DepricatedListener { public: /** diff --git a/src/net/eathena/generalhandler.h b/src/net/eathena/generalhandler.h index fc86beff2..3f817ab3a 100644 --- a/src/net/eathena/generalhandler.h +++ b/src/net/eathena/generalhandler.h @@ -23,8 +23,6 @@ #ifndef NET_EATHENA_GENERALHANDLER_H #define NET_EATHENA_GENERALHANDLER_H -#include "listener.h" - #include "net/generalhandler.h" #include "net/net.h" diff --git a/src/net/tmwa/generalhandler.h b/src/net/tmwa/generalhandler.h index ea9952fa2..2290dbe38 100644 --- a/src/net/tmwa/generalhandler.h +++ b/src/net/tmwa/generalhandler.h @@ -23,8 +23,6 @@ #ifndef NET_TMWA_GENERALHANDLER_H #define NET_TMWA_GENERALHANDLER_H -#include "listener.h" - #include "net/generalhandler.h" #include "net/net.h" diff --git a/src/playerinfo.cpp b/src/playerinfo.cpp index 7439aee60..673e6f8cf 100644 --- a/src/playerinfo.cpp +++ b/src/playerinfo.cpp @@ -24,7 +24,7 @@ #include "client.h" #include "depricatedevent.h" #include "inventory.h" -#include "listener.h" +#include "depricatedlistener.h" #include "logger.h" #include "gui/inventorywindow.h" |