From aaccf7d56c9d1c82ec83e12b64d303966a3e0035 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Mon, 27 Sep 2010 19:36:05 +0200 Subject: [PATCH] [shell] Remove GtkObject Use GObjectClass:dispose instead of GtkObjectClass:destroy. Based on a patch by Matthias Clasen. Bug #630676. --- shell/ev-sidebar-attachments.c | 8 +++----- shell/ev-sidebar-thumbnails.c | 2 -- shell/ev-sidebar.c | 18 ++++++------------ 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/shell/ev-sidebar-attachments.c b/shell/ev-sidebar-attachments.c index 3d2cce29..5b717896 100644 --- a/shell/ev-sidebar-attachments.c +++ b/shell/ev-sidebar-attachments.c @@ -472,7 +472,7 @@ ev_sidebar_attachments_get_property (GObject *object, } static void -ev_sidebar_attachments_destroy (GtkObject *object) +ev_sidebar_attachments_dispose (GObject *object) { EvSidebarAttachments *ev_attachbar = EV_SIDEBAR_ATTACHMENTS (object); @@ -494,22 +494,20 @@ ev_sidebar_attachments_destroy (GtkObject *object) ev_attachbar->priv->icon_cache = NULL; } - (* GTK_OBJECT_CLASS (ev_sidebar_attachments_parent_class)->destroy) (object); + G_OBJECT_CLASS (ev_sidebar_attachments_parent_class)->dispose (object); } static void ev_sidebar_attachments_class_init (EvSidebarAttachmentsClass *ev_attachbar_class) { GObjectClass *g_object_class; - GtkObjectClass *gtk_object_class; GtkWidgetClass *gtk_widget_class; g_object_class = G_OBJECT_CLASS (ev_attachbar_class); - gtk_object_class = GTK_OBJECT_CLASS (ev_attachbar_class); gtk_widget_class = GTK_WIDGET_CLASS (ev_attachbar_class); g_object_class->get_property = ev_sidebar_attachments_get_property; - gtk_object_class->destroy = ev_sidebar_attachments_destroy; + g_object_class->dispose = ev_sidebar_attachments_dispose; gtk_widget_class->popup_menu = ev_sidebar_attachments_popup_menu; gtk_widget_class->screen_changed = ev_sidebar_attachments_screen_changed; diff --git a/shell/ev-sidebar-thumbnails.c b/shell/ev-sidebar-thumbnails.c index 4854e930..a860c5e1 100644 --- a/shell/ev-sidebar-thumbnails.c +++ b/shell/ev-sidebar-thumbnails.c @@ -273,11 +273,9 @@ static void ev_sidebar_thumbnails_class_init (EvSidebarThumbnailsClass *ev_sidebar_thumbnails_class) { GObjectClass *g_object_class; - GtkObjectClass *gtk_object_class; GtkWidgetClass *widget_class; g_object_class = G_OBJECT_CLASS (ev_sidebar_thumbnails_class); - gtk_object_class = GTK_OBJECT_CLASS (ev_sidebar_thumbnails_class); widget_class = GTK_WIDGET_CLASS (ev_sidebar_thumbnails_class); g_object_class->dispose = ev_sidebar_thumbnails_dispose; diff --git a/shell/ev-sidebar.c b/shell/ev-sidebar.c index cf5f2a30..3a99b556 100644 --- a/shell/ev-sidebar.c +++ b/shell/ev-sidebar.c @@ -64,7 +64,7 @@ G_DEFINE_TYPE (EvSidebar, ev_sidebar, GTK_TYPE_VBOX) (G_TYPE_INSTANCE_GET_PRIVATE ((object), EV_TYPE_SIDEBAR, EvSidebarPrivate)) static void -ev_sidebar_destroy (GtkObject *object) +ev_sidebar_dispose (GObject *object) { EvSidebar *ev_sidebar = EV_SIDEBAR (object); @@ -79,7 +79,7 @@ ev_sidebar_destroy (GtkObject *object) } - (* GTK_OBJECT_CLASS (ev_sidebar_parent_class)->destroy) (object); + G_OBJECT_CLASS (ev_sidebar_parent_class)->dispose (object); } static void @@ -175,17 +175,11 @@ ev_sidebar_get_property (GObject *object, static void ev_sidebar_class_init (EvSidebarClass *ev_sidebar_class) { - GObjectClass *g_object_class; - GtkWidgetClass *widget_class; - GtkObjectClass *gtk_object_klass; - - g_object_class = G_OBJECT_CLASS (ev_sidebar_class); - widget_class = GTK_WIDGET_CLASS (ev_sidebar_class); - gtk_object_klass = GTK_OBJECT_CLASS (ev_sidebar_class); - + GObjectClass *g_object_class = G_OBJECT_CLASS (ev_sidebar_class); + g_type_class_add_private (g_object_class, sizeof (EvSidebarPrivate)); - - gtk_object_klass->destroy = ev_sidebar_destroy; + + g_object_class->dispose = ev_sidebar_dispose; g_object_class->get_property = ev_sidebar_get_property; g_object_class->set_property = ev_sidebar_set_property; -- 2.43.0