X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fsp-switch.cpp;h=bafb9de18241b8cac4bab43a7ee1873b855ab452;hb=f9cb5a9e9d6ea60cd2e8e3dc63cb070fa10f9650;hp=6884c352f170125389ce4523262ea3eea5dd6d8e;hpb=7e2d535c37ea0830491ca84263aa3793a07904e0;p=inkscape.git diff --git a/src/sp-switch.cpp b/src/sp-switch.cpp index 6884c352f..bafb9de18 100644 --- a/src/sp-switch.cpp +++ b/src/sp-switch.cpp @@ -5,6 +5,7 @@ * * Authors: * Andrius R. + * MenTaLguY * * Copyright (C) 2006 authors * @@ -21,6 +22,9 @@ #include "display/nr-arena-group.h" #include "conditions.h" +#include +#include + static void sp_switch_class_init (SPSwitchClass *klass); static void sp_switch_init (SPSwitch *group); @@ -60,7 +64,7 @@ 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() { @@ -75,9 +79,9 @@ SPObject *CSwitch::_evaluateFirst() { return NULL; } -GSList *CSwitch::_childList(bool add_ref, Action action) { - if ( ActionGeneral != action ) { - return CGroup::_childList(add_ref, action); +GSList *CSwitch::_childList(bool add_ref, SPObject::Action action) { + if ( action != SPObject::ActionGeneral ) { + return _group->childList(add_ref, action); } SPObject *child = _evaluateFirst(); @@ -120,7 +124,7 @@ void CSwitch::_reevaluate(bool add_to_arena) { _releaseLastItem(_cached_item); SPItem * child; - for ( GSList *l = _childList(false, ActionShow); + for ( GSList *l = _childList(false, SPObject::ActionShow); NULL != l ; l = g_slist_remove (l, l->data)) { SPObject *o = SP_OBJECT (l->data); @@ -133,10 +137,7 @@ void CSwitch::_reevaluate(bool add_to_arena) { } _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); } @@ -151,8 +152,7 @@ void CSwitch::_releaseLastItem(SPObject *obj) 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; } @@ -162,7 +162,7 @@ void CSwitch::_showChildren (NRArena *arena, NRArenaItem *ai, unsigned int key, NRArenaItem *ac = NULL; NRArenaItem *ar = NULL; SPItem * child; - GSList *l = _childList(false, ActionShow); + GSList *l = _childList(false, SPObject::ActionShow); while (l) { SPObject *o = SP_OBJECT (l->data); if (SP_IS_ITEM (o)) {