[Telepathy-commits] [telepathy-gabble/master] GabbleImFactory: simplify priv access
Simon McVittie
simon.mcvittie at collabora.co.uk
Tue Aug 19 10:53:59 PDT 2008
20080724144133-53eee-e9108e43683cfc3311d76588538c1cfc2e32d31f.gz
---
src/im-factory.c | 14 +++++++-------
src/im-factory.h | 2 ++
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/src/im-factory.c b/src/im-factory.c
index fda84da..11775bd 100644
--- a/src/im-factory.c
+++ b/src/im-factory.c
@@ -52,7 +52,6 @@ enum
LAST_PROPERTY
};
-typedef struct _GabbleImFactoryPrivate GabbleImFactoryPrivate;
struct _GabbleImFactoryPrivate
{
GabbleConnection *conn;
@@ -70,17 +69,18 @@ static GObject *gabble_im_factory_constructor (GType type, guint n_props,
GObjectConstructParam *props);
static void
-gabble_im_factory_init (GabbleImFactory *fac)
+gabble_im_factory_init (GabbleImFactory *self)
{
- GabbleImFactoryPrivate *priv = GABBLE_IM_FACTORY_GET_PRIVATE (fac);
+ self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GABBLE_TYPE_IM_FACTORY,
+ GabbleImFactoryPrivate);
- priv->channels = g_hash_table_new_full (g_direct_hash, g_direct_equal,
+ self->priv->channels = g_hash_table_new_full (g_direct_hash, g_direct_equal,
NULL, g_object_unref);
- priv->message_cb = NULL;
+ self->priv->message_cb = NULL;
- priv->conn = NULL;
- priv->dispose_has_run = FALSE;
+ self->priv->conn = NULL;
+ self->priv->dispose_has_run = FALSE;
}
static GObject *
diff --git a/src/im-factory.h b/src/im-factory.h
index b80e64e..ea21100 100644
--- a/src/im-factory.h
+++ b/src/im-factory.h
@@ -28,6 +28,7 @@ G_BEGIN_DECLS
typedef struct _GabbleImFactory GabbleImFactory;
typedef struct _GabbleImFactoryClass GabbleImFactoryClass;
+typedef struct _GabbleImFactoryPrivate GabbleImFactoryPrivate;
struct _GabbleImFactoryClass {
GObjectClass parent_class;
@@ -35,6 +36,7 @@ struct _GabbleImFactoryClass {
struct _GabbleImFactory {
GObject parent;
+ GabbleImFactoryPrivate *priv;
};
GType gabble_im_factory_get_type (void);
--
1.5.6.3
More information about the Telepathy-commits
mailing list