diff --git a/src/sp-switch.cpp b/src/sp-switch.cpp
index 65ecc5442ffbe0a3824b444d33c8672a0fba8086..37be6f75eef0b384e418c3ade98eec793fb86b89 100644 (file)
--- a/src/sp-switch.cpp
+++ b/src/sp-switch.cpp
*
* Authors:
* Andrius R. <knutux@gmail.com>
+ * MenTaLguY <mental@rydia.net>
*
* Copyright (C) 2006 authors
*
#include "display/nr-arena-group.h"
#include "conditions.h"
+#include <sigc++/functors/ptr_fun.h>
+#include <sigc++/adaptors/bind.h>
+
static void sp_switch_class_init (SPSwitchClass *klass);
static void sp_switch_init (SPSwitch *group);
group->group = new CSwitch(group);
}
-CSwitch::CSwitch(SPGroup *group) : CGroup(group), _cached_item(NULL), _release_handler_id(0) {
+CSwitch::CSwitch(SPGroup *group) : CGroup(group), _cached_item(NULL) {
}
CSwitch::~CSwitch() {
@@ -111,7 +115,7 @@ void CSwitch::onOrderChanged (Inkscape::XML::Node *, Inkscape::XML::Node *, Inks
_reevaluate();
}
-void CSwitch::_reevaluate(bool add_to_arena) {
+void CSwitch::_reevaluate(bool /*add_to_arena*/) {
SPObject *evaluated_child = _evaluateFirst();
if (!evaluated_child || _cached_item == evaluated_child) {
return;
}
_cached_item = evaluated_child;
- _release_handler_id = g_signal_connect(
- G_OBJECT(evaluated_child), "release",
- G_CALLBACK(&CSwitch::_releaseItem),
- this);
+ _release_connection = evaluated_child->connectRelease(sigc::bind(sigc::ptr_fun(&CSwitch::_releaseItem), this));
_group->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG);
}
if (NULL == _cached_item || _cached_item != obj)
return;
- g_signal_handler_disconnect(G_OBJECT(_cached_item), _release_handler_id);
- _release_handler_id = 0;
+ _release_connection.disconnect();
_cached_item = NULL;
}
if (ac) {
nr_arena_item_add_child (ai, ac, ar);
ar = ac;
- nr_arena_item_unref (ac);
}
}
l = g_slist_remove (l, o);