[gimp] app: implement GObject::dispose() instead of GtkWidget::destroy()



commit 3c18ba3497cc79e61c46e23cd3676d9bcae2544f
Author: Michael Natterer <mitch gimp org>
Date:   Fri Oct 15 13:48:36 2010 +0200

    app: implement GObject::dispose() instead of GtkWidget::destroy()

 app/widgets/gimpdevicestatus.c |   51 ++++++++++++++++++---------------------
 1 files changed, 24 insertions(+), 27 deletions(-)
---
diff --git a/app/widgets/gimpdevicestatus.c b/app/widgets/gimpdevicestatus.c
index 0cf4f32..967db1f 100644
--- a/app/widgets/gimpdevicestatus.c
+++ b/app/widgets/gimpdevicestatus.c
@@ -77,13 +77,12 @@ struct _GimpDeviceStatusEntry
 static GObject *gimp_device_status_constructor (GType                  type,
                                                 guint                  n_params,
                                                 GObjectConstructParam *params);
+static void gimp_device_status_dispose         (GObject               *object);
 static void gimp_device_status_set_property    (GObject               *object,
                                                 guint                  property_id,
                                                 const GValue          *value,
                                                 GParamSpec            *pspec);
 
-static void gimp_device_status_destroy         (GtkObject             *object);
-
 static void gimp_device_status_device_add      (GimpContainer         *devices,
                                                 GimpDeviceInfo        *device_info,
                                                 GimpDeviceStatus      *status);
@@ -108,14 +107,12 @@ G_DEFINE_TYPE (GimpDeviceStatus, gimp_device_status, GIMP_TYPE_EDITOR)
 static void
 gimp_device_status_class_init (GimpDeviceStatusClass *klass)
 {
-  GObjectClass   *object_class     = G_OBJECT_CLASS (klass);
-  GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (klass);
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
   object_class->constructor  = gimp_device_status_constructor;
+  object_class->dispose      = gimp_device_status_dispose;
   object_class->set_property = gimp_device_status_set_property;
 
-  gtk_object_class->destroy  = gimp_device_status_destroy;
-
   g_object_class_install_property (object_class, PROP_GIMP,
                                    g_param_spec_object ("gimp", NULL, NULL,
                                                         GIMP_TYPE_GIMP,
@@ -176,26 +173,7 @@ gimp_device_status_constructor (GType                  type,
 }
 
 static void
-gimp_device_status_set_property (GObject      *object,
-                                 guint         property_id,
-                                 const GValue *value,
-                                 GParamSpec   *pspec)
-{
-  GimpDeviceStatus *status = GIMP_DEVICE_STATUS (object);
-
-  switch (property_id)
-    {
-    case PROP_GIMP:
-      status->gimp = g_value_get_object (value);
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
-      break;
-    }
-}
-
-static void
-gimp_device_status_destroy (GtkObject *object)
+gimp_device_status_dispose (GObject *object)
 {
   GimpDeviceStatus *status = GIMP_DEVICE_STATUS (object);
 
@@ -218,7 +196,26 @@ gimp_device_status_destroy (GtkObject *object)
       status->devices = NULL;
     }
 
-  GTK_OBJECT_CLASS (parent_class)->destroy (object);
+  G_OBJECT_CLASS (parent_class)->dispose (object);
+}
+
+static void
+gimp_device_status_set_property (GObject      *object,
+                                 guint         property_id,
+                                 const GValue *value,
+                                 GParamSpec   *pspec)
+{
+  GimpDeviceStatus *status = GIMP_DEVICE_STATUS (object);
+
+  switch (property_id)
+    {
+    case PROP_GIMP:
+      status->gimp = g_value_get_object (value);
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+      break;
+    }
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]