From: mental Date: Fri, 21 Jul 2006 19:22:44 +0000 (+0000) Subject: switch to sigc++ signal for "release" X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9c0a44bb47b022c4cdb319d697ccd5a42d3253dd;p=inkscape.git switch to sigc++ signal for "release" --- diff --git a/ChangeLog b/ChangeLog index 7d4312a70..e3b843782 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-07-21 MenTaLguY + + * src/document-subset.cpp: + + switch to sigc++ signal for "release" + 2006-07-21 MenTaLguY * src/selection.cpp, src/selection.h: diff --git a/src/document-subset.cpp b/src/document-subset.cpp index 4ef547320..5fcf1641c 100644 --- a/src/document-subset.cpp +++ b/src/document-subset.cpp @@ -36,10 +36,10 @@ struct DocumentSubset::Relations : public GC::Managed, SPObject *parent; Siblings children; - gulong release_connection; + sigc::connection release_connection; sigc::connection position_changed_connection; - Record() : parent(NULL), release_connection(0) {} + Record() : parent(NULL) {} unsigned childIndex(SPObject *obj) { Siblings::iterator found; @@ -163,8 +163,9 @@ private: sp_object_ref(obj); Record &record=records[obj]; record.release_connection - = g_signal_connect(obj, "release", - (GCallback)&Relations::_release_object, this); + = obj->connectRelease( + sigc::mem_fun(this, &Relations::_release_object) + ); record.position_changed_connection = obj->connectPositionChanged( sigc::mem_fun(this, &Relations::reorder) @@ -178,10 +179,7 @@ private: void _doRemove(SPObject *obj) { Record &record=records[obj]; - if (record.release_connection) { - g_signal_handler_disconnect(obj, record.release_connection); - record.release_connection = 0; - } + record.release_connection.disconnect(); record.position_changed_connection.disconnect(); records.erase(obj); @@ -212,10 +210,9 @@ private: } } - static void _release_object(SPObject *obj, void *relations_p) { - Relations &relations=*static_cast(relations_p); - if (relations.get(obj)) { - relations.remove(obj, true); + void _release_object(SPObject *obj) { + if (get(obj)) { + remove(obj, true); } } };