diff options
author | Xavier Claessens <xclaesse@src.gnome.org> | 2008-05-06 04:34:41 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2008-05-06 04:34:41 +0800 |
commit | 1557095113a3c0f5baadcfb1e953d73762e5263e (patch) | |
tree | 6af706fb1f4f673120981e033768a09169544c11 /libempathy/empathy-irc-server.c | |
parent | 62828fac680bd53e0047d9ae2a281c864075c809 (diff) | |
download | gsoc2013-empathy-1557095113a3c0f5baadcfb1e953d73762e5263e.tar gsoc2013-empathy-1557095113a3c0f5baadcfb1e953d73762e5263e.tar.gz gsoc2013-empathy-1557095113a3c0f5baadcfb1e953d73762e5263e.tar.bz2 gsoc2013-empathy-1557095113a3c0f5baadcfb1e953d73762e5263e.tar.lz gsoc2013-empathy-1557095113a3c0f5baadcfb1e953d73762e5263e.tar.xz gsoc2013-empathy-1557095113a3c0f5baadcfb1e953d73762e5263e.tar.zst gsoc2013-empathy-1557095113a3c0f5baadcfb1e953d73762e5263e.zip |
Keep a priv pointer in the object struct instead of using G_TYPE_INSTANCE_GET_PRIVATE all the time.
svn path=/trunk/; revision=1082
Diffstat (limited to 'libempathy/empathy-irc-server.c')
-rw-r--r-- | libempathy/empathy-irc-server.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/libempathy/empathy-irc-server.c b/libempathy/empathy-irc-server.c index 510acc77b..482214532 100644 --- a/libempathy/empathy-irc-server.c +++ b/libempathy/empathy-irc-server.c @@ -28,8 +28,15 @@ #include "empathy-marshal.h" #include "empathy-irc-server.h" +#include "empathy-utils.h" -G_DEFINE_TYPE (EmpathyIrcServer, empathy_irc_server, G_TYPE_OBJECT); +#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyIrcServer) +typedef struct +{ + gchar *address; + gint port; + gboolean ssl; +} EmpathyIrcServerPriv; /* properties */ enum @@ -49,17 +56,7 @@ enum static guint signals[LAST_SIGNAL] = {0}; -typedef struct _EmpathyIrcServerPrivate EmpathyIrcServerPrivate; - -struct _EmpathyIrcServerPrivate -{ - gchar *address; - gint port; - gboolean ssl; -}; - -#define EMPATHY_IRC_SERVER_GET_PRIVATE(obj)\ - ((EmpathyIrcServerPrivate *) obj->priv) +G_DEFINE_TYPE (EmpathyIrcServer, empathy_irc_server, G_TYPE_OBJECT); static void empathy_irc_server_get_property (GObject *object, @@ -68,7 +65,7 @@ empathy_irc_server_get_property (GObject *object, GParamSpec *pspec) { EmpathyIrcServer *self = EMPATHY_IRC_SERVER (object); - EmpathyIrcServerPrivate *priv = EMPATHY_IRC_SERVER_GET_PRIVATE (self); + EmpathyIrcServerPriv *priv = GET_PRIV (self); switch (property_id) { @@ -94,7 +91,7 @@ empathy_irc_server_set_property (GObject *object, GParamSpec *pspec) { EmpathyIrcServer *self = EMPATHY_IRC_SERVER (object); - EmpathyIrcServerPrivate *priv = EMPATHY_IRC_SERVER_GET_PRIVATE (self); + EmpathyIrcServerPriv *priv = GET_PRIV (self); switch (property_id) { @@ -130,7 +127,7 @@ static void empathy_irc_server_finalize (GObject *object) { EmpathyIrcServer *self = EMPATHY_IRC_SERVER (object); - EmpathyIrcServerPrivate *priv = EMPATHY_IRC_SERVER_GET_PRIVATE (self); + EmpathyIrcServerPriv *priv = GET_PRIV (self); g_free (priv->address); @@ -140,8 +137,8 @@ empathy_irc_server_finalize (GObject *object) static void empathy_irc_server_init (EmpathyIrcServer *self) { - EmpathyIrcServerPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (self, - EMPATHY_TYPE_IRC_SERVER, EmpathyIrcServerPrivate); + EmpathyIrcServerPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (self, + EMPATHY_TYPE_IRC_SERVER, EmpathyIrcServerPriv); self->priv = priv; } @@ -155,8 +152,7 @@ empathy_irc_server_class_init (EmpathyIrcServerClass *klass) object_class->get_property = empathy_irc_server_get_property; object_class->set_property = empathy_irc_server_set_property; - g_type_class_add_private (object_class, - sizeof (EmpathyIrcServerPrivate)); + g_type_class_add_private (object_class, sizeof (EmpathyIrcServerPriv)); object_class->finalize = empathy_irc_server_finalize; |