Code

switch to sigc++ "release"
authormental <mental@users.sourceforge.net>
Thu, 27 Jul 2006 03:01:27 +0000 (03:01 +0000)
committermental <mental@users.sourceforge.net>
Thu, 27 Jul 2006 03:01:27 +0000 (03:01 +0000)
ChangeLog
src/dialogs/object-attributes.cpp

index ae6a784f53c1b622e1216480b45f9ae8bc69ba5f..6b6adff27f8c7b45adf48ff78221861820af8f3a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-07-26  MenTaLguY  <mental@rydia.net>
+
+       * src/dialogs/object-attributes.cpp:
+
+         switch to sigc++ "release"
+
 2006-07-26  MenTaLguY  <mental@rydia.net>
 
        * src/style.cpp, src/style.h:
index b62287affd29445bfeb3319e98ba586b5aabbb5a..34f7e44638cf32d3b92bd840fbb26191f01322d2 100644 (file)
 #include "sp-anchor.h"
 #include "sp-attribute-widget.h"
 
+#include <sigc++/connection.h>
+#include <sigc++/functors/ptr_fun.h>
+#include <sigc++/adaptors/bind.h>
+
 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);