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 /widgets/misc/e-account-manager.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 'widgets/misc/e-account-manager.c')
-rw-r--r-- | widgets/misc/e-account-manager.c | 39 |
1 files changed, 8 insertions, 31 deletions
diff --git a/widgets/misc/e-account-manager.c b/widgets/misc/e-account-manager.c index 2e71400f53..3186e6ffbc 100644 --- a/widgets/misc/e-account-manager.c +++ b/widgets/misc/e-account-manager.c @@ -52,9 +52,13 @@ enum { LAST_SIGNAL }; -static gpointer parent_class; static guint signals[LAST_SIGNAL]; +G_DEFINE_TYPE ( + EAccountManager, + e_account_manager, + GTK_TYPE_TABLE) + static void account_manager_default_clicked_cb (EAccountManager *manager) { @@ -193,15 +197,14 @@ account_manager_dispose (GObject *object) } /* Chain up to parent's dispose() method. */ - G_OBJECT_CLASS (parent_class)->dispose (object); + G_OBJECT_CLASS (e_account_manager_parent_class)->dispose (object); } static void -account_manager_class_init (EAccountManagerClass *class) +e_account_manager_class_init (EAccountManagerClass *class) { GObjectClass *object_class; - parent_class = g_type_class_peek_parent (class); g_type_class_add_private (class, sizeof (EAccountManagerPrivate)); object_class = G_OBJECT_CLASS (class); @@ -252,7 +255,7 @@ account_manager_class_init (EAccountManagerClass *class) } static void -account_manager_init (EAccountManager *manager) +e_account_manager_init (EAccountManager *manager) { GtkTreeSelection *selection; GtkWidget *container; @@ -358,32 +361,6 @@ account_manager_init (EAccountManager *manager) G_CALLBACK (account_manager_default_clicked_cb), manager); } -GType -e_account_manager_get_type (void) -{ - static GType type = 0; - - if (G_UNLIKELY (type == 0)) { - static const GTypeInfo type_info = { - sizeof (EAccountManagerClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) account_manager_class_init, - (GClassFinalizeFunc) NULL, - NULL, /* class_init */ - sizeof (EAccountManager), - 0, /* n_preallocs */ - (GInstanceInitFunc) account_manager_init, - NULL /* value_table */ - }; - - type = g_type_register_static ( - GTK_TYPE_TABLE, "EAccountManager", &type_info, 0); - } - - return type; -} - GtkWidget * e_account_manager_new (EAccountList *account_list) { |