]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/connector.cpp
Strip copyright messages and id tags from individual files
[libs/gltk.git] / source / connector.cpp
index 837ec80a33563ab7d928de367c51b28234f8b46a..2b64d0019af1abcb3a6c50be76e0005cc8ff54e9 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of libmspgltk
-Copyright © 2007  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #include "connector.h"
 #include "logic.h"
 
@@ -21,26 +14,28 @@ 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);
+               map<string, ConnAction *>::const_iterator j = actions.find(i->type);
                if(j!=actions.end())
                        j->second->connect(*this, *i->wdg, i->data);
+               else
+                       throw KeyError("Unknown binding type", i->type);
        }
 }
 
 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