diff options
Diffstat (limited to 'shell')
-rw-r--r-- | shell/e-shell-sidebar.c | 35 |
1 files changed, 10 insertions, 25 deletions
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); } @@ -208,27 +218,6 @@ shell_sidebar_constructed (GObject *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; |