[Telepathy-commits] [telepathy-gabble/master] Simplify access to private struct in several files

Will Thompson will.thompson at collabora.co.uk
Mon Mar 23 07:22:52 PDT 2009


---
 src/connection.c       |   43 +++++++++++++++-----------------
 src/disco.c            |   26 +++++++++-----------
 src/im-channel.c       |   24 ++++++++----------
 src/roomlist-channel.c |   24 ++++++++----------
 src/roster-channel.c   |   21 +++++++---------
 src/roster.c           |   62 +++++++++++++++++++++++------------------------
 src/vcard-manager.c    |   47 ++++++++++++++++--------------------
 7 files changed, 114 insertions(+), 133 deletions(-)

diff --git a/src/connection.c b/src/connection.c
index 97d83d9..fa30de5 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -195,8 +195,6 @@ struct _GabbleConnectionPrivate
   gboolean dispose_has_run;
 };
 
-#define GABBLE_CONNECTION_GET_PRIVATE(obj) ((obj)->priv)
-
 static void connection_capabilities_update_cb (GabblePresenceCache *,
     TpHandle, GabblePresenceCapabilities, GabblePresenceCapabilities,
     GHashTable *, GHashTable *, gpointer);
@@ -321,7 +319,7 @@ gabble_connection_get_property (GObject    *object,
                                 GParamSpec *pspec)
 {
   GabbleConnection *self = (GabbleConnection *) object;
-  GabbleConnectionPrivate *priv = GABBLE_CONNECTION_GET_PRIVATE (self);
+  GabbleConnectionPrivate *priv = self->priv;
 
   switch (property_id) {
     case PROP_CONNECT_SERVER:
@@ -397,7 +395,7 @@ gabble_connection_set_property (GObject      *object,
                                 GParamSpec   *pspec)
 {
   GabbleConnection *self = (GabbleConnection *) object;
-  GabbleConnectionPrivate *priv = GABBLE_CONNECTION_GET_PRIVATE (self);
+  GabbleConnectionPrivate *priv = self->priv;
 
   switch (property_id) {
     case PROP_CONNECT_SERVER:
@@ -487,8 +485,7 @@ static gboolean _gabble_connection_connect (TpBaseConnection *base,
 static gchar *
 gabble_connection_get_unique_name (TpBaseConnection *self)
 {
-  GabbleConnectionPrivate *priv = GABBLE_CONNECTION_GET_PRIVATE (
-      GABBLE_CONNECTION (self));
+  GabbleConnectionPrivate *priv = GABBLE_CONNECTION (self)->priv;
 
   return g_strdup_printf ("%s@%s/%s",
                           priv->username,
@@ -771,7 +768,7 @@ gabble_connection_dispose (GObject *object)
 {
   GabbleConnection *self = GABBLE_CONNECTION (object);
   TpBaseConnection *base = (TpBaseConnection *) self;
-  GabbleConnectionPrivate *priv = GABBLE_CONNECTION_GET_PRIVATE (self);
+  GabbleConnectionPrivate *priv = self->priv;
 
   if (priv->dispose_has_run)
     return;
@@ -840,7 +837,7 @@ static void
 gabble_connection_finalize (GObject *object)
 {
   GabbleConnection *self = GABBLE_CONNECTION (object);
-  GabbleConnectionPrivate *priv = GABBLE_CONNECTION_GET_PRIVATE (self);
+  GabbleConnectionPrivate *priv = self->priv;
 
   DEBUG ("called with %p", object);
 
@@ -885,7 +882,7 @@ _gabble_connection_set_properties_from_account (GabbleConnection *conn,
   g_assert (GABBLE_IS_CONNECTION (conn));
   g_assert (account != NULL);
 
-  priv = GABBLE_CONNECTION_GET_PRIVATE (conn);
+  priv = conn->priv;
 
   username = server = resource = NULL;
   result = TRUE;
@@ -932,7 +929,7 @@ _gabble_connection_send (GabbleConnection *conn, LmMessage *msg, GError **error)
 
   g_assert (GABBLE_IS_CONNECTION (conn));
 
-  priv = GABBLE_CONNECTION_GET_PRIVATE (conn);
+  priv = conn->priv;
 
   if (!lm_connection_send (conn->lmconn, msg, &lmerror))
     {
@@ -1045,7 +1042,7 @@ _gabble_connection_send_with_reply (GabbleConnection *conn,
 
   g_assert (GABBLE_IS_CONNECTION (conn));
 
-  priv = GABBLE_CONNECTION_GET_PRIVATE (conn);
+  priv = conn->priv;
 
   lm_message_ref (msg);
 
@@ -1128,7 +1125,7 @@ static void
 connect_callbacks (TpBaseConnection *base)
 {
   GabbleConnection *conn = GABBLE_CONNECTION (base);
-  GabbleConnectionPrivate *priv = GABBLE_CONNECTION_GET_PRIVATE (conn);
+  GabbleConnectionPrivate *priv = conn->priv;
 
   g_assert (priv->iq_disco_cb == NULL);
   g_assert (priv->iq_unknown_cb == NULL);
@@ -1178,7 +1175,7 @@ static void
 disconnect_callbacks (TpBaseConnection *base)
 {
   GabbleConnection *conn = GABBLE_CONNECTION (base);
-  GabbleConnectionPrivate *priv = GABBLE_CONNECTION_GET_PRIVATE (conn);
+  GabbleConnectionPrivate *priv = conn->priv;
 
   g_assert (priv->iq_disco_cb != NULL);
   g_assert (priv->iq_unknown_cb != NULL);
@@ -1237,7 +1234,7 @@ _gabble_connection_connect (TpBaseConnection *base,
                             GError **error)
 {
   GabbleConnection *conn = GABBLE_CONNECTION (base);
-  GabbleConnectionPrivate *priv = GABBLE_CONNECTION_GET_PRIVATE (conn);
+  GabbleConnectionPrivate *priv = conn->priv;
   char *jid;
 
   g_assert (priv->port <= G_MAXUINT16);
@@ -1696,7 +1693,7 @@ connection_ssl_cb (LmSSL      *lmssl,
                    gpointer    data)
 {
   GabbleConnection *conn = GABBLE_CONNECTION (data);
-  GabbleConnectionPrivate *priv = GABBLE_CONNECTION_GET_PRIVATE (conn);
+  GabbleConnectionPrivate *priv = conn->priv;
   const char *reason;
   TpConnectionStatusReason tp_reason;
 
@@ -1752,7 +1749,7 @@ connection_ssl_cb (LmSSL      *lmssl,
 static void
 do_auth (GabbleConnection *conn)
 {
-  GabbleConnectionPrivate *priv = GABBLE_CONNECTION_GET_PRIVATE (conn);
+  GabbleConnectionPrivate *priv = conn->priv;
   GError *error = NULL;
 
   DEBUG ("authenticating with username: %s, password: <hidden>, resource: %s",
@@ -1837,7 +1834,7 @@ connection_open_cb (LmConnection *lmconn,
                     gpointer      data)
 {
   GabbleConnection *conn = GABBLE_CONNECTION (data);
-  GabbleConnectionPrivate *priv = GABBLE_CONNECTION_GET_PRIVATE (conn);
+  GabbleConnectionPrivate *priv = conn->priv;
   TpBaseConnection *base = (TpBaseConnection *) conn;
 
   if ((base->status != TP_CONNECTION_STATUS_CONNECTING) &&
@@ -1906,7 +1903,7 @@ connection_auth_cb (LmConnection *lmconn,
   TpBaseConnection *base = (TpBaseConnection *) conn;
   TpHandleRepoIface *contact_handles = tp_base_connection_get_handles (base,
       TP_HANDLE_TYPE_CONTACT);
-  GabbleConnectionPrivate *priv = GABBLE_CONNECTION_GET_PRIVATE (conn);
+  GabbleConnectionPrivate *priv = conn->priv;
   GError *error = NULL;
   const gchar *jid;
 
@@ -2019,7 +2016,7 @@ connection_disco_cb (GabbleDisco *disco,
     }
 
   g_assert (GABBLE_IS_CONNECTION (conn));
-  priv = GABBLE_CONNECTION_GET_PRIVATE (conn);
+  priv = conn->priv;
 
   if (disco_error)
     {
@@ -2306,7 +2303,7 @@ gabble_connection_advertise_capabilities (TpSvcConnectionInterfaceCapabilities *
   guint i;
   GabblePresence *pres = self->self_presence;
   GabblePresenceCapabilities add_caps = 0, remove_caps = 0, caps, save_caps;
-  GabbleConnectionPrivate *priv = GABBLE_CONNECTION_GET_PRIVATE (self);
+  GabbleConnectionPrivate *priv = self->priv;
   const CapabilityConversionData *ccd;
   GPtrArray *ret;
   GError *error = NULL;
@@ -2419,7 +2416,7 @@ gabble_connection_set_self_capabilities (
 {
   GabbleConnection *self = GABBLE_CONNECTION (iface);
   TpBaseConnection *base = (TpBaseConnection *) self;
-  GabbleConnectionPrivate *priv = GABBLE_CONNECTION_GET_PRIVATE (self);
+  GabbleConnectionPrivate *priv = self->priv;
   guint i;
   GabblePresence *pres = self->self_presence;
   GHashTable *save_caps;
@@ -2726,7 +2723,7 @@ _gabble_connection_find_conference_server (GabbleConnection *conn)
 
   g_assert (GABBLE_IS_CONNECTION (conn));
 
-  priv = GABBLE_CONNECTION_GET_PRIVATE (conn);
+  priv = conn->priv;
 
   if (priv->conference_server == NULL)
     {
@@ -3117,7 +3114,7 @@ void
 gabble_connection_ensure_capabilities (GabbleConnection *self,
                                        GabblePresenceCapabilities caps)
 {
-  GabbleConnectionPrivate *priv = GABBLE_CONNECTION_GET_PRIVATE (self);
+  GabbleConnectionPrivate *priv = self->priv;
   GabblePresenceCapabilities old_caps, new_caps;
 
   old_caps = self->self_presence->caps;
diff --git a/src/disco.c b/src/disco.c
index 61c5b0a..248faef 100644
--- a/src/disco.c
+++ b/src/disco.c
@@ -92,8 +92,6 @@ gabble_disco_error_quark (void)
   return quark;
 }
 
-#define GABBLE_DISCO_GET_PRIVATE(o) ((o)->priv)
-
 static void
 gabble_disco_init (GabbleDisco *obj)
 {
@@ -150,7 +148,7 @@ gabble_disco_get_property (GObject    *object,
                                 GParamSpec *pspec)
 {
   GabbleDisco *chan = GABBLE_DISCO (object);
-  GabbleDiscoPrivate *priv = GABBLE_DISCO_GET_PRIVATE (chan);
+  GabbleDiscoPrivate *priv = chan->priv;
 
   switch (property_id) {
     case PROP_CONNECTION:
@@ -169,7 +167,7 @@ gabble_disco_set_property (GObject     *object,
                            GParamSpec   *pspec)
 {
   GabbleDisco *chan = GABBLE_DISCO (object);
-  GabbleDiscoPrivate *priv = GABBLE_DISCO_GET_PRIVATE (chan);
+  GabbleDiscoPrivate *priv = chan->priv;
 
   switch (property_id) {
     case PROP_CONNECTION:
@@ -195,7 +193,7 @@ gabble_disco_constructor (GType type, guint n_props,
   obj = G_OBJECT_CLASS (gabble_disco_parent_class)-> constructor (type,
       n_props, props);
   disco = GABBLE_DISCO (obj);
-  priv = GABBLE_DISCO_GET_PRIVATE (disco);
+  priv = disco->priv;
 
   g_signal_connect (priv->connection, "status-changed",
       G_CALLBACK (gabble_disco_conn_status_changed_cb), disco);
@@ -209,7 +207,7 @@ static void
 gabble_disco_dispose (GObject *object)
 {
   GabbleDisco *self = GABBLE_DISCO (object);
-  GabbleDiscoPrivate *priv = GABBLE_DISCO_GET_PRIVATE (self);
+  GabbleDiscoPrivate *priv = self->priv;
   GSList *l;
 
   if (priv->dispose_has_run)
@@ -282,7 +280,7 @@ delete_request (GabbleDiscoRequest *request)
   g_assert (NULL != request);
   g_assert (GABBLE_IS_DISCO (disco));
 
-  priv = GABBLE_DISCO_GET_PRIVATE (disco);
+  priv = disco->priv;
 
   g_assert (NULL != g_list_find (priv->requests, request));
 
@@ -381,7 +379,7 @@ request_reply_cb (GabbleConnection *conn, LmMessage *sent_msg,
 {
   GabbleDiscoRequest *request = (GabbleDiscoRequest *) user_data;
   GabbleDisco *disco = GABBLE_DISCO (object);
-  GabbleDiscoPrivate *priv = GABBLE_DISCO_GET_PRIVATE (disco);
+  GabbleDiscoPrivate *priv = disco->priv;
   LmMessageNode *query_node;
   GError *err = NULL;
 
@@ -478,7 +476,7 @@ gabble_disco_request_with_timeout (GabbleDisco *self, GabbleDiscoType type,
                                    gpointer user_data, GObject *object,
                                    GError **error)
 {
-  GabbleDiscoPrivate *priv = GABBLE_DISCO_GET_PRIVATE (self);
+  GabbleDiscoPrivate *priv = self->priv;
   GabbleDiscoRequest *request;
   LmMessage *msg;
   LmMessageNode *lm_node;
@@ -535,7 +533,7 @@ gabble_disco_cancel_request (GabbleDisco *disco, GabbleDiscoRequest *request)
   g_return_if_fail (GABBLE_IS_DISCO (disco));
   g_return_if_fail (NULL != request);
 
-  priv = GABBLE_DISCO_GET_PRIVATE (disco);
+  priv = disco->priv;
 
   g_return_if_fail (NULL != g_list_find (priv->requests, request));
 
@@ -852,7 +850,7 @@ static void
 services_cb (gpointer pipeline, GabbleDiscoItem *item, gpointer user_data)
 {
   GabbleDisco *disco = GABBLE_DISCO (user_data);
-  GabbleDiscoPrivate *priv = GABBLE_DISCO_GET_PRIVATE (disco);
+  GabbleDiscoPrivate *priv = disco->priv;
   GabbleDiscoItem *my_item = g_new0 (GabbleDiscoItem, 1);
 
   my_item->jid = g_strdup (item->jid);
@@ -874,7 +872,7 @@ static void
 end_cb (gpointer pipeline, gpointer user_data)
 {
   GabbleDisco *disco = GABBLE_DISCO (user_data);
-  GabbleDiscoPrivate *priv = GABBLE_DISCO_GET_PRIVATE (disco);
+  GabbleDiscoPrivate *priv = disco->priv;
 
   gabble_disco_pipeline_destroy (pipeline);
   priv->service_cache = g_slist_reverse (priv->service_cache);
@@ -889,7 +887,7 @@ gabble_disco_conn_status_changed_cb (GabbleConnection *conn,
                                      gpointer data)
 {
   GabbleDisco *disco = GABBLE_DISCO (data);
-  GabbleDiscoPrivate *priv = GABBLE_DISCO_GET_PRIVATE (disco);
+  GabbleDiscoPrivate *priv = disco->priv;
 
   if (status == TP_CONNECTION_STATUS_CONNECTED)
     {
@@ -919,7 +917,7 @@ gabble_disco_service_find (GabbleDisco *disco,
   GSList *l;
 
   g_assert (GABBLE_IS_DISCO (disco));
-  priv = GABBLE_DISCO_GET_PRIVATE (disco);
+  priv = disco->priv;
 
   for (l = priv->service_cache; l; l = g_slist_next (l))
     {
diff --git a/src/im-channel.c b/src/im-channel.c
index fb2b44c..ee97a07 100644
--- a/src/im-channel.c
+++ b/src/im-channel.c
@@ -108,8 +108,6 @@ struct _GabbleIMChannelPrivate
   gboolean dispose_has_run;
 };
 
-#define GABBLE_IM_CHANNEL_GET_PRIVATE(obj) ((obj)->priv)
-
 static void
 gabble_im_channel_init (GabbleIMChannel *self)
 {
@@ -144,7 +142,7 @@ gabble_im_channel_constructor (GType type, guint n_props,
 
   obj = G_OBJECT_CLASS (gabble_im_channel_parent_class)->
            constructor (type, n_props, props);
-  priv = GABBLE_IM_CHANNEL_GET_PRIVATE (GABBLE_IM_CHANNEL (obj));
+  priv = GABBLE_IM_CHANNEL (obj)->priv;
   conn = (TpBaseConnection *) priv->conn;
   contact_handles = tp_base_connection_get_handles (conn,
       TP_HANDLE_TYPE_CONTACT);
@@ -185,7 +183,7 @@ gabble_im_channel_get_property (GObject    *object,
                                 GParamSpec *pspec)
 {
   GabbleIMChannel *chan = GABBLE_IM_CHANNEL (object);
-  GabbleIMChannelPrivate *priv = GABBLE_IM_CHANNEL_GET_PRIVATE (chan);
+  GabbleIMChannelPrivate *priv = chan->priv;
   TpBaseConnection *base_conn = (TpBaseConnection *) priv->conn;
 
   switch (property_id) {
@@ -260,7 +258,7 @@ gabble_im_channel_set_property (GObject     *object,
                                 GParamSpec   *pspec)
 {
   GabbleIMChannel *chan = GABBLE_IM_CHANNEL (object);
-  GabbleIMChannelPrivate *priv = GABBLE_IM_CHANNEL_GET_PRIVATE (chan);
+  GabbleIMChannelPrivate *priv = chan->priv;
 
   switch (property_id) {
     case PROP_OBJECT_PATH:
@@ -392,7 +390,7 @@ static void
 gabble_im_channel_dispose (GObject *object)
 {
   GabbleIMChannel *self = GABBLE_IM_CHANNEL (object);
-  GabbleIMChannelPrivate *priv = GABBLE_IM_CHANNEL_GET_PRIVATE (self);
+  GabbleIMChannelPrivate *priv = self->priv;
   GabblePresence *presence;
   GabbleRosterSubscription subscription;
   gboolean cap_chat_states = FALSE;
@@ -444,7 +442,7 @@ static void
 gabble_im_channel_finalize (GObject *object)
 {
   GabbleIMChannel *self = GABBLE_IM_CHANNEL (object);
-  GabbleIMChannelPrivate *priv = GABBLE_IM_CHANNEL_GET_PRIVATE (self);
+  GabbleIMChannelPrivate *priv = self->priv;
   TpBaseConnection *conn = (TpBaseConnection *) priv->conn;
   TpHandleRepoIface *contact_handles = tp_base_connection_get_handles (conn,
       TP_HANDLE_TYPE_CONTACT);
@@ -478,7 +476,7 @@ _gabble_im_channel_send_message (GObject *object,
   gint state = -1;
 
   g_assert (GABBLE_IS_IM_CHANNEL (self));
-  priv = GABBLE_IM_CHANNEL_GET_PRIVATE (self);
+  priv = self->priv;
 
   presence = gabble_presence_cache_get (priv->conn->presence_cache,
       priv->handle);
@@ -519,7 +517,7 @@ _gabble_im_channel_receive (GabbleIMChannel *chan,
   TpMessage *msg;
 
   g_assert (GABBLE_IS_IM_CHANNEL (chan));
-  priv = GABBLE_IM_CHANNEL_GET_PRIVATE (chan);
+  priv = chan->priv;
   base_conn = (TpBaseConnection *) priv->conn;
 
   /* update peer's full JID if it's changed */
@@ -612,7 +610,7 @@ _gabble_im_channel_state_receive (GabbleIMChannel *chan,
 
   g_assert (state < NUM_TP_CHANNEL_CHAT_STATES);
   g_assert (GABBLE_IS_IM_CHANNEL (chan));
-  priv = GABBLE_IM_CHANNEL_GET_PRIVATE (chan);
+  priv = chan->priv;
 
   tp_svc_channel_interface_chat_state_emit_chat_state_changed (
       (TpSvcChannelInterfaceChatState *) chan,
@@ -637,7 +635,7 @@ gabble_im_channel_close (TpSvcChannel *iface,
 
   DEBUG ("called on %p", self);
 
-  priv = GABBLE_IM_CHANNEL_GET_PRIVATE (self);
+  priv = self->priv;
 
   presence = gabble_presence_cache_get (priv->conn->presence_cache,
       priv->handle);
@@ -745,7 +743,7 @@ gabble_im_channel_get_handle (TpSvcChannel *iface,
   GabbleIMChannelPrivate *priv;
 
   g_assert (GABBLE_IS_IM_CHANNEL (self));
-  priv = GABBLE_IM_CHANNEL_GET_PRIVATE (self);
+  priv = self->priv;
 
   tp_svc_channel_return_from_get_handle (context, TP_HANDLE_TYPE_CONTACT,
       priv->handle);
@@ -784,7 +782,7 @@ gabble_im_channel_set_chat_state (TpSvcChannelInterfaceChatState *iface,
   GError *error = NULL;
 
   g_assert (GABBLE_IS_IM_CHANNEL (self));
-  priv = GABBLE_IM_CHANNEL_GET_PRIVATE (self);
+  priv = self->priv;
 
   presence = gabble_presence_cache_get (priv->conn->presence_cache,
       priv->handle);
diff --git a/src/roomlist-channel.c b/src/roomlist-channel.c
index 84a7967..fcb70f6 100644
--- a/src/roomlist-channel.c
+++ b/src/roomlist-channel.c
@@ -98,8 +98,6 @@ struct _GabbleRoomlistChannelPrivate
   gboolean dispose_has_run;
 };
 
-#define GABBLE_ROOMLIST_CHANNEL_GET_PRIVATE(obj) ((obj)->priv)
-
 #define ROOM_SIGNAL_INTERVAL 300
 
 static gboolean emit_room_signal (gpointer data);
@@ -126,7 +124,7 @@ gabble_roomlist_channel_constructor (GType type, guint n_props,
 
   obj = G_OBJECT_CLASS (gabble_roomlist_channel_parent_class)->
            constructor (type, n_props, props);
-  priv = GABBLE_ROOMLIST_CHANNEL_GET_PRIVATE (GABBLE_ROOMLIST_CHANNEL (obj));
+  priv = GABBLE_ROOMLIST_CHANNEL (obj)->priv;
 
   bus = tp_get_bus ();
   dbus_g_connection_register_g_object (bus, priv->object_path, obj);
@@ -142,7 +140,7 @@ gabble_roomlist_channel_get_property (GObject    *object,
 {
   GabbleRoomlistChannel *chan = GABBLE_ROOMLIST_CHANNEL (object);
   GabbleRoomlistChannelPrivate *priv =
-    GABBLE_ROOMLIST_CHANNEL_GET_PRIVATE (chan);
+    chan->priv;
   TpBaseConnection *conn = (TpBaseConnection *) priv->conn;
 
   switch (property_id) {
@@ -217,7 +215,7 @@ gabble_roomlist_channel_set_property (GObject     *object,
 {
   GabbleRoomlistChannel *chan = GABBLE_ROOMLIST_CHANNEL (object);
   GabbleRoomlistChannelPrivate *priv =
-    GABBLE_ROOMLIST_CHANNEL_GET_PRIVATE (chan);
+    chan->priv;
   TpBaseConnection *conn;
   TpHandleRepoIface *room_handles;
   TpHandleSet *new_signalled_rooms;
@@ -382,7 +380,7 @@ gabble_roomlist_channel_dispose (GObject *object)
 {
   GabbleRoomlistChannel *self = GABBLE_ROOMLIST_CHANNEL (object);
   GabbleRoomlistChannelPrivate *priv =
-    GABBLE_ROOMLIST_CHANNEL_GET_PRIVATE (self);
+    self->priv;
 
   if (priv->dispose_has_run)
     return;
@@ -411,7 +409,7 @@ gabble_roomlist_channel_finalize (GObject *object)
 {
   GabbleRoomlistChannel *self = GABBLE_ROOMLIST_CHANNEL (object);
   GabbleRoomlistChannelPrivate *priv =
-    GABBLE_ROOMLIST_CHANNEL_GET_PRIVATE (self);
+    self->priv;
 
   /* free any data held directly by the object here */
 
@@ -445,7 +443,7 @@ emit_room_signal (gpointer data)
 {
   GabbleRoomlistChannel *chan = data;
   GabbleRoomlistChannelPrivate *priv =
-    GABBLE_ROOMLIST_CHANNEL_GET_PRIVATE (chan);
+    chan->priv;
   GType room_info_type = TP_STRUCT_TYPE_ROOM_INFO;
 
   if (!priv->listing)
@@ -490,7 +488,7 @@ room_info_cb (gpointer pipeline, GabbleDiscoItem *item, gpointer user_data)
     } while (0)
 
   g_assert (GABBLE_IS_ROOMLIST_CHANNEL (chan));
-  priv = GABBLE_ROOMLIST_CHANNEL_GET_PRIVATE (chan);
+  priv = chan->priv;
   room_handles = tp_base_connection_get_handles (
       (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_ROOM);
 
@@ -600,7 +598,7 @@ rooms_end_cb (gpointer data, gpointer user_data)
 {
   GabbleRoomlistChannel *chan = user_data;
   GabbleRoomlistChannelPrivate *priv =
-    GABBLE_ROOMLIST_CHANNEL_GET_PRIVATE (chan);
+    chan->priv;
 
   emit_room_signal (chan);
 
@@ -616,7 +614,7 @@ static void
 stop_listing (GabbleRoomlistChannel *self)
 {
   GabbleRoomlistChannelPrivate *priv =
-    GABBLE_ROOMLIST_CHANNEL_GET_PRIVATE (self);
+    self->priv;
 
   if (priv->listing)
     {
@@ -730,7 +728,7 @@ gabble_roomlist_channel_get_listing_rooms (TpSvcChannelTypeRoomList *iface,
 
   g_assert (GABBLE_IS_ROOMLIST_CHANNEL (self));
 
-  priv = GABBLE_ROOMLIST_CHANNEL_GET_PRIVATE (self);
+  priv = self->priv;
   tp_svc_channel_type_room_list_return_from_get_listing_rooms (
       context, priv->listing);
 }
@@ -757,7 +755,7 @@ gabble_roomlist_channel_list_rooms (TpSvcChannelTypeRoomList *iface,
 
   g_assert (GABBLE_IS_ROOMLIST_CHANNEL (self));
 
-  priv = GABBLE_ROOMLIST_CHANNEL_GET_PRIVATE (self);
+  priv = self->priv;
 
   priv->listing = TRUE;
   tp_svc_channel_type_room_list_emit_listing_rooms (iface, TRUE);
diff --git a/src/roster-channel.c b/src/roster-channel.c
index 3ff304a..7b8401f 100644
--- a/src/roster-channel.c
+++ b/src/roster-channel.c
@@ -87,8 +87,6 @@ struct _GabbleRosterChannelPrivate
   gboolean closed;
 };
 
-#define GABBLE_ROSTER_CHANNEL_GET_PRIVATE(obj) ((obj)->priv)
-
 static void
 gabble_roster_channel_init (GabbleRosterChannel *self)
 {
@@ -114,7 +112,7 @@ gabble_roster_channel_constructor (GType type, guint n_props,
 
   obj = G_OBJECT_CLASS (gabble_roster_channel_parent_class)->
            constructor (type, n_props, props);
-  priv = GABBLE_ROSTER_CHANNEL_GET_PRIVATE (GABBLE_ROSTER_CHANNEL (obj));
+  priv = GABBLE_ROSTER_CHANNEL (obj)->priv;
   conn = (TpBaseConnection *) priv->conn;
   handle_type = priv->handle_type;
   handle_repo = tp_base_connection_get_handles (conn, handle_type);
@@ -201,7 +199,7 @@ gabble_roster_channel_get_property (GObject    *object,
                                     GParamSpec *pspec)
 {
   GabbleRosterChannel *chan = GABBLE_ROSTER_CHANNEL (object);
-  GabbleRosterChannelPrivate *priv = GABBLE_ROSTER_CHANNEL_GET_PRIVATE (chan);
+  GabbleRosterChannelPrivate *priv = chan->priv;
 
   switch (property_id) {
     case PROP_OBJECT_PATH:
@@ -268,7 +266,7 @@ gabble_roster_channel_set_property (GObject     *object,
                                     GParamSpec   *pspec)
 {
   GabbleRosterChannel *chan = GABBLE_ROSTER_CHANNEL (object);
-  GabbleRosterChannelPrivate *priv = GABBLE_ROSTER_CHANNEL_GET_PRIVATE (chan);
+  GabbleRosterChannelPrivate *priv = chan->priv;
 
   switch (property_id) {
     case PROP_OBJECT_PATH:
@@ -404,7 +402,7 @@ void
 gabble_roster_channel_dispose (GObject *object)
 {
   GabbleRosterChannel *self = GABBLE_ROSTER_CHANNEL (object);
-  GabbleRosterChannelPrivate *priv = GABBLE_ROSTER_CHANNEL_GET_PRIVATE (self);
+  GabbleRosterChannelPrivate *priv = self->priv;
 
   if (priv->dispose_has_run)
     return;
@@ -424,7 +422,7 @@ void
 gabble_roster_channel_finalize (GObject *object)
 {
   GabbleRosterChannel *self = GABBLE_ROSTER_CHANNEL (object);
-  GabbleRosterChannelPrivate *priv = GABBLE_ROSTER_CHANNEL_GET_PRIVATE (self);
+  GabbleRosterChannelPrivate *priv = self->priv;
   TpBaseConnection *conn = (TpBaseConnection *) priv->conn;
   TpHandleRepoIface *handle_repo = tp_base_connection_get_handles (conn,
       priv->handle_type);
@@ -459,7 +457,7 @@ _gabble_roster_channel_add_member_cb (GObject *obj,
   TpHandleRepoIface *contact_repo;
   const gchar *contact_id;
 
-  priv = GABBLE_ROSTER_CHANNEL_GET_PRIVATE (GABBLE_ROSTER_CHANNEL (obj));
+  priv = GABBLE_ROSTER_CHANNEL (obj)->priv;
 
 #ifdef ENABLE_DEBUG
   handle_repo = tp_base_connection_get_handles ((TpBaseConnection *) priv->conn,
@@ -538,7 +536,7 @@ _gabble_roster_channel_remove_member_cb (GObject *obj,
   gboolean ret = FALSE;
   const gchar *contact_id;
 
-  priv = GABBLE_ROSTER_CHANNEL_GET_PRIVATE (GABBLE_ROSTER_CHANNEL (obj));
+  priv = GABBLE_ROSTER_CHANNEL (obj)->priv;
   conn = (TpBaseConnection *) priv->conn;
 #ifdef ENABLE_DEBUG
   handle_repo = tp_base_connection_get_handles (conn, priv->handle_type);
@@ -627,7 +625,7 @@ gabble_roster_channel_close (TpSvcChannel *iface,
 
   g_assert (GABBLE_IS_ROSTER_CHANNEL (self));
 
-  priv = GABBLE_ROSTER_CHANNEL_GET_PRIVATE (self);
+  priv = self->priv;
 
   if (priv->handle_type == TP_HANDLE_TYPE_LIST)
     {
@@ -690,8 +688,7 @@ gabble_roster_channel_get_handle (TpSvcChannel *iface,
 
   g_assert (GABBLE_IS_ROSTER_CHANNEL (self));
 
-  priv = GABBLE_ROSTER_CHANNEL_GET_PRIVATE (self);
-
+  priv = self->priv;
   tp_svc_channel_return_from_get_handle (context, priv->handle_type,
       priv->handle);
 }
diff --git a/src/roster.c b/src/roster.c
index 1d28e3c..a107511 100644
--- a/src/roster.c
+++ b/src/roster.c
@@ -137,8 +137,6 @@ G_DEFINE_TYPE_WITH_CODE (GabbleRoster, gabble_roster, G_TYPE_OBJECT,
       channel_manager_iface_init);
     G_IMPLEMENT_INTERFACE (GABBLE_TYPE_CAPS_CHANNEL_MANAGER, NULL));
 
-#define GABBLE_ROSTER_GET_PRIVATE(o) ((o)->priv)
-
 static void
 gabble_roster_class_init (GabbleRosterClass *gabble_roster_class)
 {
@@ -197,7 +195,7 @@ void
 gabble_roster_dispose (GObject *object)
 {
   GabbleRoster *self = GABBLE_ROSTER (object);
-  GabbleRosterPrivate *priv = GABBLE_ROSTER_GET_PRIVATE (self);
+  GabbleRosterPrivate *priv = self->priv;
 
   if (priv->dispose_has_run)
     return;
@@ -233,7 +231,7 @@ void
 gabble_roster_finalize (GObject *object)
 {
   GabbleRoster *self = GABBLE_ROSTER (object);
-  GabbleRosterPrivate *priv = GABBLE_ROSTER_GET_PRIVATE (self);
+  GabbleRosterPrivate *priv = self->priv;
 
   DEBUG ("called with %p", object);
 
@@ -250,7 +248,7 @@ gabble_roster_get_property (GObject    *object,
                             GParamSpec *pspec)
 {
   GabbleRoster *roster = GABBLE_ROSTER (object);
-  GabbleRosterPrivate *priv = GABBLE_ROSTER_GET_PRIVATE (roster);
+  GabbleRosterPrivate *priv = roster->priv;
 
   switch (property_id) {
     case PROP_CONNECTION:
@@ -269,7 +267,7 @@ gabble_roster_set_property (GObject     *object,
                             GParamSpec   *pspec)
 {
   GabbleRoster *roster = GABBLE_ROSTER (object);
-  GabbleRosterPrivate *priv = GABBLE_ROSTER_GET_PRIVATE (roster);
+  GabbleRosterPrivate *priv = roster->priv;
 
   switch (property_id) {
     case PROP_CONNECTION:
@@ -447,7 +445,7 @@ static GabbleRosterItem *
 _gabble_roster_item_get (GabbleRoster *roster,
                          TpHandle handle)
 {
-  GabbleRosterPrivate *priv = GABBLE_ROSTER_GET_PRIVATE (roster);
+  GabbleRosterPrivate *priv = roster->priv;
   TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
       (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
   TpHandleRepoIface *group_repo = tp_base_connection_get_handles (
@@ -489,7 +487,7 @@ static void
 _gabble_roster_item_remove (GabbleRoster *roster,
                             TpHandle handle)
 {
-  GabbleRosterPrivate *priv = GABBLE_ROSTER_GET_PRIVATE (roster);
+  GabbleRosterPrivate *priv = roster->priv;
   TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
       (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
 
@@ -583,7 +581,7 @@ _gabble_roster_item_update (GabbleRoster *roster,
                             GHashTable *group_updates,
                             gboolean google_roster_mode)
 {
-  GabbleRosterPrivate *priv = GABBLE_ROSTER_GET_PRIVATE (roster);
+  GabbleRosterPrivate *priv = roster->priv;
   GabbleRosterItem *item;
   const gchar *ask, *name;
   TpIntSet *new_groups, *added_to, *removed_from, *removed_from2;
@@ -718,7 +716,7 @@ _gabble_roster_message_new (GabbleRoster *roster,
                             LmMessageSubType sub_type,
                             LmMessageNode **query_return)
 {
-  GabbleRosterPrivate *priv = GABBLE_ROSTER_GET_PRIVATE (roster);
+  GabbleRosterPrivate *priv = roster->priv;
   LmMessage *message;
   LmMessageNode *query_node;
 
@@ -781,7 +779,7 @@ _gabble_roster_item_to_message (GabbleRoster *roster,
                                 LmMessageNode **item_return,
                                 GabbleRosterItem *item)
 {
-  GabbleRosterPrivate *priv = GABBLE_ROSTER_GET_PRIVATE (roster);
+  GabbleRosterPrivate *priv = roster->priv;
   TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
       (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
   LmMessage *message;
@@ -846,7 +844,7 @@ static void
 gabble_roster_emit_new_channel (GabbleRoster *self,
                                 GabbleRosterChannel *channel)
 {
-  GabbleRosterPrivate *priv = GABBLE_ROSTER_GET_PRIVATE (self);
+  GabbleRosterPrivate *priv = self->priv;
   GSList *requests_satisfied;
 
   requests_satisfied = g_hash_table_lookup (priv->queued_requests, channel);
@@ -899,7 +897,7 @@ _gabble_roster_create_channel (GabbleRoster *roster,
                                TpHandle handle,
                                gpointer request_token)
 {
-  GabbleRosterPrivate *priv = GABBLE_ROSTER_GET_PRIVATE (roster);
+  GabbleRosterPrivate *priv = roster->priv;
   TpBaseConnection *conn = (TpBaseConnection *) priv->conn;
   TpHandleRepoIface *handle_repo = tp_base_connection_get_handles (conn,
       handle_type);
@@ -973,7 +971,7 @@ _gabble_roster_get_channel (GabbleRoster *roster,
                             gboolean *created,
                             gpointer request_token)
 {
-  GabbleRosterPrivate *priv = GABBLE_ROSTER_GET_PRIVATE (roster);
+  GabbleRosterPrivate *priv = roster->priv;
   TpHandleRepoIface *handle_repo = tp_base_connection_get_handles (
       (TpBaseConnection *) priv->conn, handle_type);
   GabbleRosterChannel *chan;
@@ -1022,7 +1020,7 @@ _gabble_roster_emit_one (gpointer key,
   GabbleRoster *roster = data_struct->roster;
   GabbleRosterChannel *chan = GABBLE_ROSTER_CHANNEL (value);
 #ifdef ENABLE_DEBUG
-  GabbleRosterPrivate *priv = GABBLE_ROSTER_GET_PRIVATE (roster);
+  GabbleRosterPrivate *priv = roster->priv;
   TpHandleRepoIface *handle_repo = tp_base_connection_get_handles (
       (TpBaseConnection *) priv->conn, data_struct->handle_type);
   TpHandle handle = GPOINTER_TO_UINT (key);
@@ -1043,7 +1041,7 @@ _gabble_roster_emit_one (gpointer key,
 static void
 _gabble_roster_received (GabbleRoster *roster)
 {
-  GabbleRosterPrivate *priv = GABBLE_ROSTER_GET_PRIVATE (roster);
+  GabbleRosterPrivate *priv = roster->priv;
 
   g_assert (priv->list_channels != NULL);
 
@@ -1112,7 +1110,7 @@ gabble_roster_iq_cb (LmMessageHandler *handler,
                      gpointer user_data)
 {
   GabbleRoster *roster = GABBLE_ROSTER (user_data);
-  GabbleRosterPrivate *priv = GABBLE_ROSTER_GET_PRIVATE (roster);
+  GabbleRosterPrivate *priv = roster->priv;
   TpBaseConnection *conn = (TpBaseConnection *) priv->conn;
   TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (conn,
       TP_HANDLE_TYPE_CONTACT);
@@ -1460,7 +1458,7 @@ _gabble_roster_send_presence_ack (GabbleRoster *roster,
                                   LmMessageSubType sub_type,
                                   gboolean changed)
 {
-  GabbleRosterPrivate *priv = GABBLE_ROSTER_GET_PRIVATE (roster);
+  GabbleRosterPrivate *priv = roster->priv;
   LmMessage *reply;
 
   if (!changed)
@@ -1511,7 +1509,7 @@ gabble_roster_presence_cb (LmMessageHandler *handler,
                            gpointer user_data)
 {
   GabbleRoster *roster = GABBLE_ROSTER (user_data);
-  GabbleRosterPrivate *priv = GABBLE_ROSTER_GET_PRIVATE (roster);
+  GabbleRosterPrivate *priv = roster->priv;
   TpBaseConnection *conn = (TpBaseConnection *) priv->conn;
   TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (conn,
       TP_HANDLE_TYPE_CONTACT);
@@ -1677,7 +1675,7 @@ cancel_queued_requests (gpointer k,
 static void
 gabble_roster_close_all (GabbleRoster *self)
 {
-  GabbleRosterPrivate *priv = GABBLE_ROSTER_GET_PRIVATE (self);
+  GabbleRosterPrivate *priv = self->priv;
 
   DEBUG ("closing channels");
 
@@ -1815,7 +1813,7 @@ gabble_roster_foreach_channel (TpChannelManager *manager,
                                gpointer data)
 {
   GabbleRoster *roster = GABBLE_ROSTER (manager);
-  GabbleRosterPrivate *priv = GABBLE_ROSTER_GET_PRIVATE (roster);
+  GabbleRosterPrivate *priv = roster->priv;
   struct foreach_data foreach;
 
   foreach.func = func;
@@ -1833,7 +1831,7 @@ gabble_roster_associate_request (GabbleRoster *self,
                                  GabbleRosterChannel *channel,
                                  gpointer request)
 {
-  GabbleRosterPrivate *priv = GABBLE_ROSTER_GET_PRIVATE (self);
+  GabbleRosterPrivate *priv = self->priv;
   GSList *list = g_hash_table_lookup (priv->queued_requests, channel);
 
   g_hash_table_steal (priv->queued_requests, channel);
@@ -1895,7 +1893,7 @@ roster_item_apply_edits (GabbleRoster *roster,
   gboolean altered = FALSE, ret;
   GabbleRosterItem edited_item;
   TpIntSet *intset;
-  GabbleRosterPrivate *priv = GABBLE_ROSTER_GET_PRIVATE (roster);
+  GabbleRosterPrivate *priv = roster->priv;
   TpHandleRepoIface *group_repo = tp_base_connection_get_handles (
       (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_GROUP);
   GabbleRosterItemEdit *edits = item->unsent_edits;
@@ -2074,7 +2072,7 @@ GabbleRosterSubscription
 gabble_roster_handle_get_subscription (GabbleRoster *roster,
                                        TpHandle handle)
 {
-  GabbleRosterPrivate *priv = GABBLE_ROSTER_GET_PRIVATE (roster);
+  GabbleRosterPrivate *priv = roster->priv;
   TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
       (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
   GabbleRosterItem *item;
@@ -2099,7 +2097,7 @@ gabble_roster_handle_set_blocked (GabbleRoster *roster,
                                   gboolean blocked,
                                   GError **error)
 {
-  GabbleRosterPrivate *priv = GABBLE_ROSTER_GET_PRIVATE (roster);
+  GabbleRosterPrivate *priv = roster->priv;
   TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
       (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
   GabbleRosterItem *item;
@@ -2168,7 +2166,7 @@ gboolean
 gabble_roster_handle_has_entry (GabbleRoster *roster,
                                 TpHandle handle)
 {
-  GabbleRosterPrivate *priv = GABBLE_ROSTER_GET_PRIVATE (roster);
+  GabbleRosterPrivate *priv = roster->priv;
   TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
       (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
   GabbleRosterItem *item;
@@ -2187,7 +2185,7 @@ const gchar *
 gabble_roster_handle_get_name (GabbleRoster *roster,
                                TpHandle handle)
 {
-  GabbleRosterPrivate *priv = GABBLE_ROSTER_GET_PRIVATE (roster);
+  GabbleRosterPrivate *priv = roster->priv;
   TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
       (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
   GabbleRosterItem *item;
@@ -2211,7 +2209,7 @@ gabble_roster_handle_set_name (GabbleRoster *roster,
                                const gchar *name,
                                GError **error)
 {
-  GabbleRosterPrivate *priv = GABBLE_ROSTER_GET_PRIVATE (roster);
+  GabbleRosterPrivate *priv = roster->priv;
   TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
       (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
   GabbleRosterItem *item;
@@ -2266,7 +2264,7 @@ gabble_roster_handle_remove (GabbleRoster *roster,
                              TpHandle handle,
                              GError **error)
 {
-  GabbleRosterPrivate *priv = GABBLE_ROSTER_GET_PRIVATE (roster);
+  GabbleRosterPrivate *priv = roster->priv;
   TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
       (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
   GabbleRosterItem *item;
@@ -2319,7 +2317,7 @@ gabble_roster_handle_add (GabbleRoster *roster,
                           TpHandle handle,
                           GError **error)
 {
-  GabbleRosterPrivate *priv = GABBLE_ROSTER_GET_PRIVATE (roster);
+  GabbleRosterPrivate *priv = roster->priv;
   TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
       (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
   GabbleRosterItem *item;
@@ -2379,7 +2377,7 @@ gabble_roster_handle_add_to_group (GabbleRoster *roster,
                                    TpHandle group,
                                    GError **error)
 {
-  GabbleRosterPrivate *priv = GABBLE_ROSTER_GET_PRIVATE (roster);
+  GabbleRosterPrivate *priv = roster->priv;
   TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
       (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
   TpHandleRepoIface *group_repo = tp_base_connection_get_handles (
@@ -2441,7 +2439,7 @@ gabble_roster_handle_remove_from_group (GabbleRoster *roster,
                                         TpHandle group,
                                         GError **error)
 {
-  GabbleRosterPrivate *priv = GABBLE_ROSTER_GET_PRIVATE (roster);
+  GabbleRosterPrivate *priv = roster->priv;
   TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
       (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
   TpHandleRepoIface *group_repo = tp_base_connection_get_handles (
diff --git a/src/vcard-manager.c b/src/vcard-manager.c
index 6f39708..418b772 100644
--- a/src/vcard-manager.c
+++ b/src/vcard-manager.c
@@ -171,8 +171,6 @@ gabble_vcard_manager_cache_quark (void)
   return quark;
 }
 
-#define GABBLE_VCARD_MANAGER_GET_PRIVATE(o) ((o)->priv)
-
 static void cache_entry_free (void *data);
 static gint cache_entry_compare (gconstpointer a, gconstpointer b);
 
@@ -248,7 +246,7 @@ gabble_vcard_manager_get_property (GObject *object,
                                    GParamSpec *pspec)
 {
   GabbleVCardManager *chan = GABBLE_VCARD_MANAGER (object);
-  GabbleVCardManagerPrivate *priv = GABBLE_VCARD_MANAGER_GET_PRIVATE (chan);
+  GabbleVCardManagerPrivate *priv = chan->priv;
 
   switch (property_id) {
     case PROP_CONNECTION:
@@ -270,7 +268,7 @@ gabble_vcard_manager_set_property (GObject *object,
                                    GParamSpec *pspec)
 {
   GabbleVCardManager *chan = GABBLE_VCARD_MANAGER (object);
-  GabbleVCardManagerPrivate *priv = GABBLE_VCARD_MANAGER_GET_PRIVATE (chan);
+  GabbleVCardManagerPrivate *priv = chan->priv;
 
   switch (property_id) {
     case PROP_CONNECTION:
@@ -298,8 +296,7 @@ static void
 cache_entry_free (gpointer data)
 {
   GabbleVCardCacheEntry *entry = data;
-  GabbleVCardManagerPrivate *priv =
-      GABBLE_VCARD_MANAGER_GET_PRIVATE (entry->manager);
+  GabbleVCardManagerPrivate *priv = entry->manager->priv;
   TpHandleRepoIface *contact_repo = tp_base_connection_get_handles
       ((TpBaseConnection *) priv->connection, TP_HANDLE_TYPE_CONTACT);
 
@@ -326,7 +323,7 @@ cache_entry_free (gpointer data)
 static GabbleVCardCacheEntry *
 cache_entry_get (GabbleVCardManager *manager, TpHandle handle)
 {
-  GabbleVCardManagerPrivate *priv = GABBLE_VCARD_MANAGER_GET_PRIVATE (manager);
+  GabbleVCardManagerPrivate *priv = manager->priv;
   TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
       (TpBaseConnection *) priv->connection, TP_HANDLE_TYPE_CONTACT);
   GabbleVCardCacheEntry *entry;
@@ -349,7 +346,7 @@ static gboolean
 cache_entry_timeout (gpointer data)
 {
   GabbleVCardManager *manager = data;
-  GabbleVCardManagerPrivate *priv = GABBLE_VCARD_MANAGER_GET_PRIVATE (manager);
+  GabbleVCardManagerPrivate *priv = manager->priv;
   GabbleVCardCacheEntry *entry;
 
   time_t now = time (NULL);
@@ -381,8 +378,7 @@ cache_entry_timeout (gpointer data)
 static void
 cache_entry_attempt_to_free (GabbleVCardCacheEntry *entry)
 {
-  GabbleVCardManagerPrivate *priv = GABBLE_VCARD_MANAGER_GET_PRIVATE
-      (entry->manager);
+  GabbleVCardManagerPrivate *priv = entry->manager->priv;
   TpBaseConnection *base = (TpBaseConnection *) priv->connection;
 
   if (entry->vcard_node != NULL)
@@ -422,7 +418,7 @@ void
 gabble_vcard_manager_invalidate_cache (GabbleVCardManager *manager,
                                        TpHandle handle)
 {
-  GabbleVCardManagerPrivate *priv = GABBLE_VCARD_MANAGER_GET_PRIVATE (manager);
+  GabbleVCardManagerPrivate *priv = manager->priv;
   GabbleVCardCacheEntry *entry = g_hash_table_lookup (priv->cache,
       GUINT_TO_POINTER (handle));
   TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
@@ -497,7 +493,7 @@ static void
 gabble_vcard_manager_dispose (GObject *object)
 {
   GabbleVCardManager *self = GABBLE_VCARD_MANAGER (object);
-  GabbleVCardManagerPrivate *priv = GABBLE_VCARD_MANAGER_GET_PRIVATE (self);
+  GabbleVCardManagerPrivate *priv = self->priv;
 
   if (priv->dispose_has_run)
     return;
@@ -584,7 +580,7 @@ initial_request_cb (GabbleVCardManager *self,
                     GError *error,
                     gpointer user_data)
 {
-  GabbleVCardManagerPrivate *priv = GABBLE_VCARD_MANAGER_GET_PRIVATE (self);
+  GabbleVCardManagerPrivate *priv = self->priv;
   gchar *alias = (gchar *) user_data;
   gchar *sha1;
 
@@ -615,7 +611,7 @@ status_changed_cb (GObject *object,
                    gpointer user_data)
 {
   GabbleVCardManager *self = GABBLE_VCARD_MANAGER (user_data);
-  GabbleVCardManagerPrivate *priv = GABBLE_VCARD_MANAGER_GET_PRIVATE (self);
+  GabbleVCardManagerPrivate *priv = self->priv;
   GabbleConnection *conn = GABBLE_CONNECTION (object);
   TpBaseConnection *base = (TpBaseConnection *) conn;
 
@@ -862,7 +858,7 @@ replace_reply_cb (GabbleConnection *conn,
                   GError *error)
 {
   GabbleVCardManager *manager = GABBLE_VCARD_MANAGER (user_data);
-  GabbleVCardManagerPrivate *priv = GABBLE_VCARD_MANAGER_GET_PRIVATE (manager);
+  GabbleVCardManagerPrivate *priv = manager->priv;
   TpBaseConnection *base = (TpBaseConnection *) conn;
 
   GError *err = get_error_from_pipeline_reply (reply_msg, error);
@@ -998,7 +994,7 @@ static void
 manager_patch_vcard (GabbleVCardManager *manager,
                      LmMessageNode *vcard_node)
 {
-  GabbleVCardManagerPrivate *priv = GABBLE_VCARD_MANAGER_GET_PRIVATE (manager);
+  GabbleVCardManagerPrivate *priv = manager->priv;
   LmMessage *msg;
   LmMessageNode *patched_vcard;
   GList *li;
@@ -1054,7 +1050,7 @@ pipeline_reply_cb (GabbleConnection *conn,
 {
   GabbleVCardCacheEntry *entry = user_data;
   GabbleVCardManager *manager = GABBLE_VCARD_MANAGER (entry->manager);
-  GabbleVCardManagerPrivate *priv = GABBLE_VCARD_MANAGER_GET_PRIVATE (manager);
+  GabbleVCardManagerPrivate *priv = manager->priv;
   TpBaseConnection *base = (TpBaseConnection *) conn;
   TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (base,
       TP_HANDLE_TYPE_CONTACT);
@@ -1149,8 +1145,7 @@ notify_delete_request (gpointer data, GObject *obj)
 static void
 cache_entry_ensure_queued (GabbleVCardCacheEntry *entry, guint timeout)
 {
-  GabbleConnection *conn =
-    GABBLE_VCARD_MANAGER_GET_PRIVATE (entry->manager)->connection;
+  GabbleConnection *conn = entry->manager->priv->connection;
   TpBaseConnection *base = (TpBaseConnection *) conn;
   TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (base,
       TP_HANDLE_TYPE_CONTACT);
@@ -1205,7 +1200,7 @@ gabble_vcard_manager_request (GabbleVCardManager *self,
                               gpointer user_data,
                               GObject *object)
 {
-  GabbleVCardManagerPrivate *priv = GABBLE_VCARD_MANAGER_GET_PRIVATE (self);
+  GabbleVCardManagerPrivate *priv = self->priv;
   TpBaseConnection *connection = (TpBaseConnection *) priv->connection;
   TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
       connection, TP_HANDLE_TYPE_CONTACT);
@@ -1249,7 +1244,7 @@ gabble_vcard_manager_edit (GabbleVCardManager *self,
 {
   va_list ap;
   size_t i;
-  GabbleVCardManagerPrivate *priv = GABBLE_VCARD_MANAGER_GET_PRIVATE (self);
+  GabbleVCardManagerPrivate *priv = self->priv;
   TpBaseConnection *base = (TpBaseConnection *) priv->connection;
   GabbleVCardManagerEditRequest *req;
   GabbleVCardCacheEntry *entry;
@@ -1307,7 +1302,7 @@ gabble_vcard_manager_edit (GabbleVCardManager *self,
 void
 gabble_vcard_manager_remove_edit_request (GabbleVCardManagerEditRequest *request)
 {
-  GabbleVCardManagerPrivate *priv = GABBLE_VCARD_MANAGER_GET_PRIVATE (request->manager);
+  GabbleVCardManagerPrivate *priv = request->manager->priv;
 
   DEBUG("request == %p", request);
 
@@ -1336,7 +1331,7 @@ notify_delete_edit_request (gpointer data, GObject *obj)
 static void
 cancel_all_edit_requests (GabbleVCardManager *manager)
 {
-  GabbleVCardManagerPrivate *priv = GABBLE_VCARD_MANAGER_GET_PRIVATE (manager);
+  GabbleVCardManagerPrivate *priv = manager->priv;
   GError cancelled = { GABBLE_VCARD_MANAGER_ERROR,
       GABBLE_VCARD_MANAGER_ERROR_CANCELLED,
       "Request cancelled" };
@@ -1374,7 +1369,7 @@ gabble_vcard_manager_get_cached (GabbleVCardManager *self,
                                  TpHandle handle,
                                  LmMessageNode **node)
 {
-  GabbleVCardManagerPrivate *priv = GABBLE_VCARD_MANAGER_GET_PRIVATE (self);
+  GabbleVCardManagerPrivate *priv = self->priv;
   GabbleVCardCacheEntry *entry = g_hash_table_lookup (priv->cache,
       GUINT_TO_POINTER (handle));
   TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
@@ -1406,7 +1401,7 @@ gabble_vcard_manager_get_cached_alias (GabbleVCardManager *manager,
 
   g_return_val_if_fail (GABBLE_IS_VCARD_MANAGER (manager), NULL);
 
-  priv = GABBLE_VCARD_MANAGER_GET_PRIVATE (manager);
+  priv = manager->priv;
   contact_repo = tp_base_connection_get_handles (
       (TpBaseConnection *) priv->connection, TP_HANDLE_TYPE_CONTACT);
 
@@ -1434,7 +1429,7 @@ gabble_vcard_manager_has_cached_alias (GabbleVCardManager *manager,
 
   g_return_val_if_fail (GABBLE_IS_VCARD_MANAGER (manager), FALSE);
 
-  priv = GABBLE_VCARD_MANAGER_GET_PRIVATE (manager);
+  priv = manager->priv;
   contact_repo = tp_base_connection_get_handles (
       (TpBaseConnection *) priv->connection, TP_HANDLE_TYPE_CONTACT);
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list