From: mental Date: Sat, 29 Jul 2006 20:01:59 +0000 (+0000) Subject: switch to sigc++ SPObject signals for gradient toolbar X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5abe8ed39a53bb35702bfa6ae72cc7f571df1c83;p=inkscape.git switch to sigc++ SPObject signals for gradient toolbar --- diff --git a/ChangeLog b/ChangeLog index ce423c3c2..3031f428a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-06-29 MenTaLguY + + * src/widgets/gradient-toolbar.cpp, src/widgets/gradient-toolbar.cpp: + + switch to sigc++ SPObject signals + 2006-06-27 MenTaLguY * src/dialogs/sp-attribute-widget.cpp, diff --git a/src/widgets/gradient-toolbar.cpp b/src/widgets/gradient-toolbar.cpp index da84eafca..cd6afac12 100644 --- a/src/widgets/gradient-toolbar.cpp +++ b/src/widgets/gradient-toolbar.cpp @@ -429,12 +429,6 @@ static void gr_disconnect_sigc (GObject *obj, sigc::connection *connection) { delete connection; } -static void gr_disconnect_gsignal (GObject *widget, gpointer defs) { - if (defs && G_IS_OBJECT(defs)) - sp_signal_disconnect_by_data (defs, widget); -} - - static void gr_edit (GtkWidget *button, GtkWidget *widget) { @@ -533,12 +527,14 @@ gr_change_widget (SPDesktop *desktop) g_signal_connect(G_OBJECT(widget), "destroy", G_CALLBACK(gr_disconnect_sigc), conn3); // connect to release and modified signals of the defs (i.e. when someone changes gradient) - g_signal_connect (G_OBJECT (SP_DOCUMENT_DEFS (document)), "release", G_CALLBACK (gr_defs_release), widget); - g_signal_connect (G_OBJECT (SP_DOCUMENT_DEFS (document)), "modified", G_CALLBACK (gr_defs_modified), widget); + sigc::connection *release_connection = new sigc::connection(); + *release_connection = SP_DOCUMENT_DEFS(document)->connectRelease(sigc::bind<1>(sigc::ptr_fun(&gr_defs_release), widget)); + sigc::connection *modified_connection = new sigc::connection(); + *modified_connection = SP_DOCUMENT_DEFS(document)->connectModified(sigc::bind<2>(sigc::ptr_fun(&gr_defs_modified), widget)); // when widget is destroyed, disconnect - g_signal_connect(G_OBJECT(widget), "destroy", G_CALLBACK(gr_disconnect_gsignal), G_OBJECT (SP_DOCUMENT_DEFS (document))); - g_signal_connect(G_OBJECT(widget), "destroy", G_CALLBACK(gr_disconnect_gsignal), G_OBJECT (SP_DOCUMENT_DEFS (document))); + g_signal_connect(G_OBJECT(widget), "destroy", G_CALLBACK(gr_disconnect_sigc), release_connection); + g_signal_connect(G_OBJECT(widget), "destroy", G_CALLBACK(gr_disconnect_sigc), modified_connection); gtk_widget_show_all (widget); return widget;