diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-12-01 10:53:20 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-02-20 23:04:25 +0800 |
commit | 23f5773903d64a554d977ae7d0ebbaca73528f1f (patch) | |
tree | 104e1a59da8bf96b004bce204b79f47bbe0a6d13 /addressbook/gui/widgets/eab-config.c | |
parent | 49bc4c2d765ee1780c23fdc9f42152850dabb220 (diff) | |
download | gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar.gz gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar.bz2 gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar.lz gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar.xz gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar.zst gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.zip |
Coding style and whitespace cleanup.
Diffstat (limited to 'addressbook/gui/widgets/eab-config.c')
-rw-r--r-- | addressbook/gui/widgets/eab-config.c | 44 |
1 files changed, 15 insertions, 29 deletions
diff --git a/addressbook/gui/widgets/eab-config.c b/addressbook/gui/widgets/eab-config.c index 6974df22d1..df91f12802 100644 --- a/addressbook/gui/widgets/eab-config.c +++ b/addressbook/gui/widgets/eab-config.c @@ -26,17 +26,22 @@ #include "eab-config.h" +#define EAB_CONFIG_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), EAB_TYPE_CONFIG, EABConfigPrivate)) + static GObjectClass *ecp_parent_class; struct _EABConfigPrivate { guint source_changed_id; }; +G_DEFINE_TYPE (EABConfig, eab_config, E_TYPE_CONFIG) + static void -ecp_init (EABConfig *cfg) +eab_config_init (EABConfig *cfg) { - cfg->priv = G_TYPE_INSTANCE_GET_PRIVATE ( - cfg, EAB_TYPE_CONFIG, EABConfigPrivate); + cfg->priv = EAB_CONFIG_GET_PRIVATE (cfg); } static void @@ -89,7 +94,7 @@ static void ecp_set_target (EConfig *ec, EConfigTarget *t) { - struct _EABConfigPrivate *p = EAB_CONFIG (ec)->priv; + struct _EABConfigPrivate *p = EAB_CONFIG_GET_PRIVATE (ec); ((EConfigClass *) ecp_parent_class)->set_target (ec, t); @@ -109,34 +114,15 @@ ecp_set_target (EConfig *ec, } static void -ecp_class_init (GObjectClass *klass) +eab_config_class_init (EABConfigClass *class) { - ((EConfigClass *) klass)->set_target = ecp_set_target; - ((EConfigClass *) klass)->target_free = ecp_target_free; + EConfigClass *config_class; - g_type_class_add_private (klass, sizeof (struct _EABConfigPrivate)); -} - -GType -eab_config_get_type (void) -{ - static GType type = 0; - - if (!type) { - static const GTypeInfo info = { - sizeof (EABConfigClass), - NULL, NULL, - (GClassInitFunc) ecp_class_init, - NULL, NULL, - sizeof (EABConfig), 0, - (GInstanceInitFunc) ecp_init - }; - - ecp_parent_class = g_type_class_ref (e_config_get_type ()); - type = g_type_register_static (e_config_get_type (), "EABConfig", &info, 0); - } + g_type_class_add_private (class, sizeof (struct _EABConfigPrivate)); - return type; + config_class = E_CONFIG_CLASS (class); + config_class->set_target = ecp_set_target; + config_class->target_free = ecp_target_free; } EABConfig * |