From 8a539cb9d32e7082b6a2774815acc2eccc5e1694 Mon Sep 17 00:00:00 2001 From: mental Date: Thu, 27 Jul 2006 03:01:27 +0000 Subject: [PATCH] switch to sigc++ "release" --- ChangeLog | 6 ++++++ src/dialogs/object-attributes.cpp | 15 +++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index ae6a784f5..6b6adff27 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-07-26 MenTaLguY + + * src/dialogs/object-attributes.cpp: + + switch to sigc++ "release" + 2006-07-26 MenTaLguY * src/style.cpp, src/style.h: diff --git a/src/dialogs/object-attributes.cpp b/src/dialogs/object-attributes.cpp index b62287aff..34f7e4463 100644 --- a/src/dialogs/object-attributes.cpp +++ b/src/dialogs/object-attributes.cpp @@ -21,6 +21,10 @@ #include "sp-anchor.h" #include "sp-attribute-widget.h" +#include +#include +#include + struct SPAttrDesc { gchar const *label; gchar const *attribute; @@ -55,7 +59,7 @@ static const SPAttrDesc image_desc[] = { static void -object_released (GtkObject *object, GtkWidget *widget) +object_released (SPObject *object, GtkWidget *widget) { gtk_widget_destroy (widget); } @@ -65,7 +69,9 @@ object_released (GtkObject *object, GtkWidget *widget) static void window_destroyed (GtkObject *window, GtkObject *object) { - sp_signal_disconnect_by_data (object, window); + sigc::connection *release_connection = (sigc::connection *)g_object_get_data(G_OBJECT(window), "release_connection"); + release_connection->disconnect(); + delete release_connection; } @@ -102,8 +108,9 @@ sp_object_attr_show_dialog ( SPObject *object, g_signal_connect ( G_OBJECT (w), "destroy", G_CALLBACK (window_destroyed), object ); - g_signal_connect ( G_OBJECT (object), "release", - G_CALLBACK (object_released), w ); + sigc::connection *release_connection = new sigc::connection(); + *release_connection = object->connectRelease(sigc::bind<1>(sigc::ptr_fun(&object_released), w)); + g_object_set_data(G_OBJECT(w), "release_connection", release_connection); gtk_widget_show (w); -- 2.30.2