Code

switch to sigc++ SPObject signals for gradient toolbar
authormental <mental@users.sourceforge.net>
Sat, 29 Jul 2006 20:01:59 +0000 (20:01 +0000)
committermental <mental@users.sourceforge.net>
Sat, 29 Jul 2006 20:01:59 +0000 (20:01 +0000)
ChangeLog
src/widgets/gradient-toolbar.cpp

index ce423c3c21d45cd3de045a0d673479410dcecc70..3031f428a6060790a8ec45a9b8ba2a8d4f9c0fa8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-06-29  MenTaLguY  <mental@rydia.net>
+
+       * src/widgets/gradient-toolbar.cpp, src/widgets/gradient-toolbar.cpp:
+
+         switch to sigc++ SPObject signals
+
 2006-06-27  MenTaLguY  <mental@rydia.net>
 
        * src/dialogs/sp-attribute-widget.cpp,
index da84eafca659ad5161ed310e53588293adcbd6c4..cd6afac124f13425da5741c04f4e1198e802a295 100644 (file)
@@ -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;