From 1557095113a3c0f5baadcfb1e953d73762e5263e Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Mon, 5 May 2008 20:34:41 +0000 Subject: Keep a priv pointer in the object struct instead of using G_TYPE_INSTANCE_GET_PRIVATE all the time. svn path=/trunk/; revision=1082 --- libempathy/empathy-contact-factory.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'libempathy/empathy-contact-factory.c') diff --git a/libempathy/empathy-contact-factory.c b/libempathy/empathy-contact-factory.c index e9469bac9..2169e7108 100644 --- a/libempathy/empathy-contact-factory.c +++ b/libempathy/empathy-contact-factory.c @@ -24,15 +24,10 @@ #include "empathy-contact-factory.h" #include "empathy-utils.h" -#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \ - EMPATHY_TYPE_CONTACT_FACTORY, EmpathyContactFactoryPriv)) - -struct _EmpathyContactFactoryPriv { +#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyContactFactory) +typedef struct { GHashTable *accounts; -}; - -static void empathy_contact_factory_class_init (EmpathyContactFactoryClass *klass); -static void empathy_contact_factory_init (EmpathyContactFactory *factory); +} EmpathyContactFactoryPriv; G_DEFINE_TYPE (EmpathyContactFactory, empathy_contact_factory, G_TYPE_OBJECT); @@ -153,8 +148,10 @@ empathy_contact_factory_class_init (EmpathyContactFactoryClass *klass) static void empathy_contact_factory_init (EmpathyContactFactory *factory) { - EmpathyContactFactoryPriv *priv = GET_PRIV (factory); + EmpathyContactFactoryPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (factory, + EMPATHY_TYPE_CONTACT_FACTORY, EmpathyContactFactoryPriv); + factory->priv = priv; priv->accounts = g_hash_table_new_full (empathy_account_hash, empathy_account_equal, g_object_unref, -- cgit v1.2.3