From 3b74f2348e60711c0141ac9888efd9a9973db34b Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Tue, 21 Dec 2004 15:50:38 +0000 Subject: convert to G_DEFINE_TYPE 2004-12-21 JP Rosevear * e-account.c: convert to G_DEFINE_TYPE * e-account-list.c: ditto svn path=/trunk/; revision=28165 --- e-util/e-account.c | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'e-util/e-account.c') diff --git a/e-util/e-account.c b/e-util/e-account.c index c75c0cf7f8..b919a56cc2 100644 --- a/e-util/e-account.c +++ b/e-util/e-account.c @@ -18,7 +18,7 @@ */ #ifdef HAVE_CONFIG_H -#include "config.h" +#include #endif #include "e-account.h" @@ -27,16 +27,12 @@ #include -#include #include #include #include #include -#define PARENT_TYPE G_TYPE_OBJECT -static GObjectClass *parent_class = NULL; - enum { CHANGED, LAST_SIGNAL @@ -44,6 +40,8 @@ enum { static guint signals[LAST_SIGNAL]; +G_DEFINE_TYPE (EAccount, e_account, G_TYPE_OBJECT) + /* lock mail accounts Relatively difficult -- involves redesign of the XML blobs which describe accounts disable adding mail accounts Simple -- can be done with just a Gconf key and some UI work to make assoc. widgets unavailable @@ -79,15 +77,16 @@ set trash emptying frequency ** lock destination account/options */ -static void finalize (GObject *); +static void e_account_finalize (GObject *); static void -class_init (GObjectClass *object_class) +e_account_class_init (EAccountClass *klass) { - parent_class = g_type_class_ref (PARENT_TYPE); - + GObjectClass *object_class; + /* virtual method override */ - object_class->finalize = finalize; + object_class = G_OBJECT_CLASS (klass); + object_class->finalize = e_account_finalize; signals[CHANGED] = g_signal_new("changed", @@ -101,7 +100,7 @@ class_init (GObjectClass *object_class) } static void -init (EAccount *account) +e_account_init (EAccount *account) { account->id = g_new0 (EAccountIdentity, 1); account->source = g_new0 (EAccountService, 1); @@ -138,7 +137,7 @@ service_destroy (EAccountService *service) } static void -finalize (GObject *object) +e_account_finalize (GObject *object) { EAccount *account = E_ACCOUNT (object); @@ -159,12 +158,9 @@ finalize (GObject *object) g_free (account->smime_sign_key); g_free (account->smime_encrypt_key); - G_OBJECT_CLASS (parent_class)->finalize (object); + G_OBJECT_CLASS (e_account_parent_class)->finalize (object); } -E_MAKE_TYPE (e_account, "EAccount", EAccount, class_init, init, PARENT_TYPE) - - /** * e_account_new: * -- cgit