diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-08-24 23:21:41 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-08-25 02:37:02 +0800 |
commit | ecf3434da05b1f39f793c24b38bfd278e10b5786 (patch) | |
tree | 485ed2399920ecb10dbee2b4db4c437c22574a20 /modules/mail/em-composer-prefs.c | |
parent | f1d2541c487fbf7433a1b9aad8e8982ef08b85f5 (diff) | |
download | gsoc2013-evolution-ecf3434da05b1f39f793c24b38bfd278e10b5786.tar.gz 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 'modules/mail/em-composer-prefs.c')
-rw-r--r-- | modules/mail/em-composer-prefs.c | 39 |
1 files changed, 7 insertions, 32 deletions
diff --git a/modules/mail/em-composer-prefs.c b/modules/mail/em-composer-prefs.c index 5e0b3405c5..7db5238a62 100644 --- a/modules/mail/em-composer-prefs.c +++ b/modules/mail/em-composer-prefs.c @@ -55,7 +55,10 @@ #include "em-config.h" #include "em-folder-selection-button.h" -static gpointer parent_class; +G_DEFINE_TYPE ( + EMComposerPrefs, + em_composer_prefs, + GTK_TYPE_VBOX) static gboolean transform_color_to_string (const GValue *src_value, @@ -169,49 +172,21 @@ composer_prefs_finalize (GObject *object) g_object_unref (prefs->builder); /* Chain up to parent's finalize() method. */ - G_OBJECT_CLASS (parent_class)->finalize (object); + G_OBJECT_CLASS (em_composer_prefs_parent_class)->finalize (object); } static void -composer_prefs_class_init (EMComposerPrefsClass *class) +em_composer_prefs_class_init (EMComposerPrefsClass *class) { GObjectClass *object_class; - parent_class = g_type_class_peek_parent (class); - object_class = G_OBJECT_CLASS (class); object_class->finalize = composer_prefs_finalize; } static void -composer_prefs_init (EMComposerPrefs *prefs) -{ -} - -GType -em_composer_prefs_get_type (void) +em_composer_prefs_init (EMComposerPrefs *prefs) { - static GType type = 0; - - if (G_UNLIKELY (type == 0)) { - static const GTypeInfo type_info = { - sizeof (EMComposerPrefsClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) composer_prefs_class_init, - (GClassFinalizeFunc) NULL, - NULL, /* class_data */ - sizeof (EMComposerPrefs), - 0, /* n_allocs */ - (GInstanceInitFunc) composer_prefs_init, - NULL /* value_table */ - }; - - type = g_type_register_static ( - GTK_TYPE_VBOX, "EMComposerPrefs", &type_info, 0); - } - - return type; } void |