From ecf3434da05b1f39f793c24b38bfd278e10b5786 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 24 Aug 2010 11:21:41 -0400 Subject: 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. --- composer/e-composer-from-header.c | 39 +++++++-------------------------------- 1 file changed, 7 insertions(+), 32 deletions(-) (limited to 'composer/e-composer-from-header.c') diff --git a/composer/e-composer-from-header.c b/composer/e-composer-from-header.c index 4dadfa7ac7..856d36a1e8 100644 --- a/composer/e-composer-from-header.c +++ b/composer/e-composer-from-header.c @@ -29,9 +29,13 @@ enum { LAST_SIGNAL }; -static gpointer parent_class; static guint signal_ids[LAST_SIGNAL]; +G_DEFINE_TYPE ( + EComposerFromHeader, + e_composer_from_header, + E_TYPE_COMPOSER_HEADER) + static void composer_from_header_changed_cb (EAccountComboBox *combo_box, EComposerFromHeader *header) @@ -47,10 +51,8 @@ composer_from_header_refreshed_cb (EAccountComboBox *combo_box, } static void -composer_from_header_class_init (EComposerFromHeaderClass *class) +e_composer_from_header_class_init (EComposerFromHeaderClass *class) { - parent_class = g_type_class_peek_parent (class); - signal_ids[REFRESHED] = g_signal_new ( "refreshed", G_TYPE_FROM_CLASS (class), @@ -61,7 +63,7 @@ composer_from_header_class_init (EComposerFromHeaderClass *class) } static void -composer_from_header_init (EComposerFromHeader *header) +e_composer_from_header_init (EComposerFromHeader *header) { GtkWidget *widget; @@ -75,33 +77,6 @@ composer_from_header_init (EComposerFromHeader *header) E_COMPOSER_HEADER (header)->input_widget = widget; } -GType -e_composer_from_header_get_type (void) -{ - static GType type = 0; - - if (G_UNLIKELY (type == 0)) { - static const GTypeInfo type_info = { - sizeof (EComposerFromHeaderClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) composer_from_header_class_init, - (GClassFinalizeFunc) NULL, - NULL, /* class_data */ - sizeof (EComposerFromHeader), - 0, /* n_preallocs */ - (GInstanceInitFunc) composer_from_header_init, - NULL /* value_table */ - }; - - type = g_type_register_static ( - E_TYPE_COMPOSER_HEADER, "EComposerFromHeader", - &type_info, 0); - } - - return type; -} - EComposerHeader * e_composer_from_header_new (const gchar *label) { -- cgit v1.2.3