X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Feventdispatcher.cpp;h=06a594f76d397165789940184f7c1a8d0ab65771;hp=d7e367c67e7141e34d213a607d3d00c859aa4b71;hb=49c1f3c3ffdf318579a809f3f800442c0c76c818;hpb=e0ebde8e33b1915860e6d253f5cefb33a8cd6ee0 diff --git a/source/eventdispatcher.cpp b/source/eventdispatcher.cpp index d7e367c..06a594f 100644 --- a/source/eventdispatcher.cpp +++ b/source/eventdispatcher.cpp @@ -1,9 +1,3 @@ -/* $Id$ - -This file is part of libmspio -Copyright © 2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ #include #include "base.h" #include "eventdispatcher.h" @@ -17,12 +11,12 @@ EventDispatcher::EventDispatcher() void EventDispatcher::add(Base &obj) { - SlotMap::iterator i=objects.find(&obj); + SlotMap::iterator i = objects.find(&obj); if(i==objects.end()) { - i=objects.insert(SlotMap::value_type(&obj, Slot(&obj))).first; - i->second.evch_conn=obj.signal_events_changed.connect(sigc::bind(sigc::mem_fun(this, &EventDispatcher::object_events_changed), &obj)); - i->second.del_conn=obj.signal_deleted.connect(sigc::bind(sigc::mem_fun(this, &EventDispatcher::object_deleted), &obj)); + i = objects.insert(SlotMap::value_type(&obj, Slot(&obj))).first; + i->second.evch_conn = obj.signal_events_changed.connect(sigc::bind(sigc::mem_fun(this, &EventDispatcher::object_events_changed), &obj)); + i->second.del_conn = obj.signal_deleted.connect(sigc::bind(sigc::mem_fun(this, &EventDispatcher::object_deleted), &obj)); if(obj.get_events()) poller.set_object(obj, obj.get_events()); @@ -31,7 +25,7 @@ void EventDispatcher::add(Base &obj) void EventDispatcher::remove(Base &obj) { - SlotMap::iterator i=objects.find(&obj); + SlotMap::iterator i = objects.find(&obj); if(i!=objects.end()) { i->second.evch_conn.disconnect(); @@ -72,7 +66,7 @@ void EventDispatcher::object_deleted(Base *obj) void EventDispatcher::dispatch() { - const Poller::SlotSeq &result=poller.get_result(); + const Poller::SlotSeq &result = poller.get_result(); for(Poller::SlotSeq::const_iterator i=result.begin(); i!=result.end(); ++i) i->object->event(i->events); }