]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/connector.cpp
Bump version
[libs/gltk.git] / source / connector.cpp
index 837ec80a33563ab7d928de367c51b28234f8b46a..9915ecc19d8df6291f87c0d84350990d8a2847e8 100644 (file)
@@ -1,10 +1,4 @@
-/* $Id$
-
-This file is part of libmspgltk
-Copyright © 2007  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
+#include <msp/core/maputils.h>
 #include "connector.h"
 #include "logic.h"
 
@@ -21,26 +15,25 @@ Connector::~Connector()
 
 void Connector::connect(const Logic &logic)
 {
-       const list<Logic::WidgetAction> &logic_acts=logic.get_actions();
+       const list<Logic::WidgetBinding> &logic_binds = logic.get_bindings();
 
-       for(list<Logic::WidgetAction>::const_iterator i=logic_acts.begin(); i!=logic_acts.end(); ++i)
+       for(list<Logic::WidgetBinding>::const_iterator i=logic_binds.begin(); i!=logic_binds.end(); ++i)
        {
-               map<string, ConnAction *>::const_iterator j=actions.find(i->type);
-               if(j!=actions.end())
-                       j->second->connect(*this, *i->wdg, i->data);
+               ConnAction *action = get_item(actions, i->type);
+               action->connect(*this, *i->wdg, i->data);
        }
 }
 
 void Connector::add(const string &type, ConnAction *act)
 {
-       map<string, ConnAction *>::iterator i=actions.find(type);
+       map<string, ConnAction *>::iterator i = actions.find(type);
        if(i!=actions.end())
        {
                delete i->second;
-               i->second=act;
+               i->second = act;
        }
        else
-               actions[type]=act;
+               actions[type] = act;
 }
 
 } // namespace GLtk