[goffice] GOComboBox: code cleanup.



commit f233508c3a194bf7004baca6f0e4cb5287100dc2
Author: Morten Welinder <terra gnome org>
Date:   Thu Apr 18 12:21:40 2013 -0400

    GOComboBox: code cleanup.

 ChangeLog                  |  3 +++
 goffice/gtk/go-combo-box.c | 16 +++++++++-------
 2 files changed, 12 insertions(+), 7 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 1e642d8..ef2c93a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2013-04-18  Morten Welinder  <terra gnome org>
 
+       * goffice/gtk/go-combo-box.c (go_combo_box_dispose): Rename from
+       go_combo_box_destroy and hooked up accordingly.
+
        * goffice/gtk/go-combo-pixmaps.c (go_combo_pixmaps_init): Keep a
        ref to grid.
        (go_combo_pixmaps_screen_changed): Install as class handler, not
diff --git a/goffice/gtk/go-combo-box.c b/goffice/gtk/go-combo-box.c
index 1aa3cea..0a6c600 100644
--- a/goffice/gtk/go-combo-box.c
+++ b/goffice/gtk/go-combo-box.c
@@ -63,7 +63,9 @@ struct _GOComboBoxPrivate {
        GtkWidget *tearable;    /* The tearoff "button" */
        GtkWidget *popup;       /* Popup */
 
-       gboolean   updating_buttons;
+       gboolean updating_buttons;
+
+       gboolean show_arrow;
 };
 static GObjectClass *go_combo_box_parent_class;
 static guint go_combo_box_signals [LAST_SIGNAL] = { 0, };
@@ -115,10 +117,9 @@ go_combo_box_finalize (GObject *object)
 }
 
 static void
-go_combo_box_destroy (GtkWidget *widget)
+go_combo_box_dispose (GObject *obj)
 {
-       GtkWidgetClass *klass = (GtkWidgetClass *)go_combo_box_parent_class;
-       GOComboBox *combo_box = GO_COMBO_BOX (widget);
+       GOComboBox *combo_box = GO_COMBO_BOX (obj);
 
        if (combo_box->priv->toplevel) {
                gtk_widget_destroy (combo_box->priv->toplevel);
@@ -132,8 +133,7 @@ go_combo_box_destroy (GtkWidget *widget)
                combo_box->priv->tearoff_window = NULL;
        }
 
-       if (klass->destroy)
-                klass->destroy (widget);
+       go_combo_box_parent_class->dispose (obj);
 }
 
 /* Cut and paste from gtkwindow.c */
@@ -250,9 +250,10 @@ go_combo_box_class_init (GObjectClass *object_class)
        go_combo_box_parent_class = g_type_class_peek_parent (object_class);
 
        object_class->finalize = go_combo_box_finalize;
+       object_class->dispose = go_combo_box_dispose;
+
        widget_class->mnemonic_activate = go_combo_box_mnemonic_activate;
        widget_class->realize = go_combo_box_realize;
-       ((GtkWidgetClass *)object_class)->destroy = go_combo_box_destroy;
 
        gtk_widget_class_install_style_property
                (widget_class,
@@ -523,6 +524,7 @@ go_combo_box_init (GOComboBox *combo_box)
 
        combo_box->priv = g_new0 (GOComboBoxPrivate, 1);
        combo_box->priv->updating_buttons = FALSE;
+       combo_box->priv->show_arrow = TRUE;
 
        combo_box->priv->arrow_button = gtk_toggle_button_new ();
        gtk_button_set_relief (GTK_BUTTON (combo_box->priv->arrow_button), GTK_RELIEF_NONE);


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