aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-action-combo-box.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-08-24 23:21:41 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-08-25 02:37:02 +0800
commitecf3434da05b1f39f793c24b38bfd278e10b5786 (patch)
tree485ed2399920ecb10dbee2b4db4c437c22574a20 /widgets/misc/e-action-combo-box.c
parentf1d2541c487fbf7433a1b9aad8e8982ef08b85f5 (diff)
downloadgsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar
gsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar.gz
gsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar.bz2
gsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar.lz
gsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar.xz
gsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar.zst
gsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.zip
GObject boilerplate cleanup.
Prefer thread-safe G_DEFINE_TYPE and G_DEFINE_INTERFACE macros over manual GType registration. This is just a start... lots more to do.
Diffstat (limited to 'widgets/misc/e-action-combo-box.c')
-rw-r--r--widgets/misc/e-action-combo-box.c41
1 files changed, 8 insertions, 33 deletions
diff --git a/widgets/misc/e-action-combo-box.c b/widgets/misc/e-action-combo-box.c
index 0260c6e19a..2a3d419b93 100644
--- a/widgets/misc/e-action-combo-box.c
+++ b/widgets/misc/e-action-combo-box.c
@@ -46,7 +46,10 @@ struct _EActionComboBoxPrivate {
gboolean group_has_icons : 1;
};
-static gpointer parent_class;
+G_DEFINE_TYPE (
+ EActionComboBox,
+ e_action_combo_box,
+ GTK_TYPE_COMBO_BOX)
static void
action_combo_box_action_changed_cb (GtkRadioAction *action,
@@ -329,7 +332,7 @@ action_combo_box_dispose (GObject *object)
g_hash_table_remove_all (priv->index);
/* Chain up to parent's dispose() method. */
- G_OBJECT_CLASS (parent_class)->dispose (object);
+ G_OBJECT_CLASS (e_action_combo_box_parent_class)->dispose (object);
}
static void
@@ -340,7 +343,7 @@ action_combo_box_finalize (GObject *object)
g_hash_table_destroy (priv->index);
/* Chain up to parent's finalize() method. */
- G_OBJECT_CLASS (parent_class)->finalize (object);
+ G_OBJECT_CLASS (e_action_combo_box_parent_class)->finalize (object);
}
static void
@@ -363,12 +366,11 @@ action_combo_box_changed (GtkComboBox *combo_box)
}
static void
-action_combo_box_class_init (EActionComboBoxClass *class)
+e_action_combo_box_class_init (EActionComboBoxClass *class)
{
GObjectClass *object_class;
GtkComboBoxClass *combo_box_class;
- parent_class = g_type_class_peek_parent (class);
g_type_class_add_private (class, sizeof (EActionComboBoxPrivate));
object_class = G_OBJECT_CLASS (class);
@@ -392,7 +394,7 @@ action_combo_box_class_init (EActionComboBoxClass *class)
}
static void
-action_combo_box_init (EActionComboBox *combo_box)
+e_action_combo_box_init (EActionComboBox *combo_box)
{
GtkCellRenderer *renderer;
@@ -424,33 +426,6 @@ action_combo_box_init (EActionComboBox *combo_box)
(GDestroyNotify) gtk_tree_row_reference_free);
}
-GType
-e_action_combo_box_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- static const GTypeInfo type_info = {
- sizeof (EActionComboBoxClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) action_combo_box_class_init,
- (GClassFinalizeFunc) NULL,
- NULL, /* class_data */
- sizeof (EActionComboBox),
- 0, /* n_preallocs */
- (GInstanceInitFunc) action_combo_box_init,
- NULL /* value_table */
- };
-
- type = g_type_register_static (
- GTK_TYPE_COMBO_BOX, "EActionComboBox",
- &type_info, 0);
- }
-
- return type;
-}
-
GtkWidget *
e_action_combo_box_new (void)
{