From dfb63508572e2bc39d7148e35c3f5889e5d69ee7 Mon Sep 17 00:00:00 2001 From: mental Date: Fri, 28 Jul 2006 03:18:31 +0000 Subject: [PATCH] switch to sigc++ SPObject signals for SPOffset --- ChangeLog | 4 ++-- src/sp-offset.cpp | 11 +++++++++-- src/sp-offset.h | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8f8d200e9..c1addd370 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,8 @@ 2006-06-27 MenTaLguY - * src/sp-shape.cpp, src/sp-shape.h: + * src/sp-offset.cpp, src/sp-offset.h, src/sp-shape.cpp, src/sp-shape.h: - switch to sigc++ SPObject signals for SPShape + switch to sigc++ SPObject signals 2006-07-26 MenTaLguY diff --git a/src/sp-offset.cpp b/src/sp-offset.cpp index 6aead7a54..2253bf1e1 100644 --- a/src/sp-offset.cpp +++ b/src/sp-offset.cpp @@ -179,6 +179,7 @@ sp_offset_init(SPOffset *offset) offset->sourceHref = NULL; offset->sourceRepr = NULL; offset->sourceObject = NULL; + new (&offset->_modified_connection) sigc::connection(); new (&offset->_delete_connection) sigc::connection(); new (&offset->_changed_connection) sigc::connection(); new (&offset->_transformed_connection) sigc::connection(); @@ -196,8 +197,14 @@ sp_offset_finalize(GObject *obj) SPOffset *offset = (SPOffset *) obj; delete offset->sourceRef; + + offset->_modified_connection.disconnect(); + offset->_modified_connection.~connection(); + offset->_delete_connection.disconnect(); offset->_delete_connection.~connection(); + offset->_changed_connection.disconnect(); offset->_changed_connection.~connection(); + offset->_transformed_connection.disconnect(); offset->_transformed_connection.~connection(); } @@ -1057,7 +1064,7 @@ static void sp_offset_start_listening(SPOffset *offset,SPObject* to) offset->_delete_connection = SP_OBJECT(to)->connectDelete(sigc::bind(sigc::ptr_fun(&sp_offset_delete_self), offset)); offset->_transformed_connection = SP_ITEM(to)->connectTransformed(sigc::bind(sigc::ptr_fun(&sp_offset_move_compensate), offset)); - offset->_modified_connection = g_signal_connect (G_OBJECT (to), "modified", G_CALLBACK (sp_offset_source_modified), offset); + offset->_modified_connection = SP_OBJECT(to)->connectModified(sigc::bind<2>(sigc::ptr_fun(&sp_offset_source_modified), offset)); } static void sp_offset_quit_listening(SPOffset *offset) @@ -1065,7 +1072,7 @@ static void sp_offset_quit_listening(SPOffset *offset) if ( offset->sourceObject == NULL ) return; - g_signal_handler_disconnect (offset->sourceObject, offset->_modified_connection); + offset->_modified_connection.disconnect(); offset->_delete_connection.disconnect(); offset->_transformed_connection.disconnect(); diff --git a/src/sp-offset.h b/src/sp-offset.h index 52c793d0e..08df8a1ea 100644 --- a/src/sp-offset.h +++ b/src/sp-offset.h @@ -73,7 +73,7 @@ struct SPOffset : public SPShape { Inkscape::XML::Node *sourceRepr; ///< the repr associated with that id SPObject *sourceObject; - gulong _modified_connection; + sigc::connection _modified_connection; sigc::connection _delete_connection; sigc::connection _changed_connection; sigc::connection _transformed_connection; -- 2.30.2