From 1c6f2d154e74f908e2c4a137de0233b5faf4f6b6 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 6 Oct 2010 19:26:08 +0200 Subject: Bug #631320 - GtkObject is gone in GTK3 --- shell/e-shell-sidebar.c | 35 ++++++++++------------------------- 1 file changed, 10 insertions(+), 25 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-sidebar.c b/shell/e-shell-sidebar.c index 61a688360f..4e4ace07c9 100644 --- a/shell/e-shell-sidebar.c +++ b/shell/e-shell-sidebar.c @@ -158,6 +158,16 @@ shell_sidebar_dispose (GObject *object) priv->shell_view = NULL; } + /* Unparent the widget before destroying it to avoid + * writing a custom GtkContainer::remove() method. */ + + if (priv->event_box != NULL) { + gtk_widget_unparent (priv->event_box); + gtk_widget_destroy (priv->event_box); + g_object_unref (priv->event_box); + priv->event_box = NULL; + } + /* Chain up to parent's dispose() method. */ G_OBJECT_CLASS (e_shell_sidebar_parent_class)->dispose (object); } @@ -207,27 +217,6 @@ shell_sidebar_constructed (GObject *object) e_extensible_load_extensions (E_EXTENSIBLE (object)); } -static void -shell_sidebar_destroy (GtkObject *gtk_object) -{ - EShellSidebarPrivate *priv; - - priv = E_SHELL_SIDEBAR_GET_PRIVATE (gtk_object); - - /* Unparent the widget before destroying it to avoid - * writing a custom GtkContainer::remove() method. */ - - if (priv->event_box != NULL) { - gtk_widget_unparent (priv->event_box); - gtk_widget_destroy (priv->event_box); - g_object_unref (priv->event_box); - priv->event_box = NULL; - } - - /* Chain up to parent's destroy() method. */ - GTK_OBJECT_CLASS (e_shell_sidebar_parent_class)->destroy (gtk_object); -} - static void shell_sidebar_size_request (GtkWidget *widget, GtkRequisition *requisition) @@ -304,7 +293,6 @@ static void e_shell_sidebar_class_init (EShellSidebarClass *class) { GObjectClass *object_class; - GtkObjectClass *gtk_object_class; GtkWidgetClass *widget_class; GtkContainerClass *container_class; @@ -317,9 +305,6 @@ e_shell_sidebar_class_init (EShellSidebarClass *class) object_class->finalize = shell_sidebar_finalize; object_class->constructed = shell_sidebar_constructed; - gtk_object_class = GTK_OBJECT_CLASS (class); - gtk_object_class->destroy = shell_sidebar_destroy; - widget_class = GTK_WIDGET_CLASS (class); widget_class->size_request = shell_sidebar_size_request; widget_class->size_allocate = shell_sidebar_size_allocate; -- cgit