From a5f081b7fa5ad0379c15cd13116b015204bd4646 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 14 Sep 2012 14:42:29 +0100 Subject: [PATCH 12/21] McdChannel: use tp_channel_get_requested instead of reinventing it MC's reinvention was potentially better if the channel might lack the Requested property... but that property has been mandatory for years, so CMs that haven't caught up can just deal with it. Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55391 --- src/mcd-channel.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/src/mcd-channel.c b/src/mcd-channel.c index 4f0a893..4310ba0 100644 --- a/src/mcd-channel.c +++ b/src/mcd-channel.c @@ -120,8 +120,6 @@ on_channel_ready (GObject *source_object, GAsyncResult *result, gpointer user_da { TpChannel *tp_chan = TP_CHANNEL (source_object); McdChannel *channel, **channel_ptr = user_data; - McdChannelPrivate *priv; - gboolean requested, valid; GError *error = NULL; if (!tp_proxy_prepare_finish (tp_chan, result, &error)) @@ -145,12 +143,7 @@ on_channel_ready (GObject *source_object, GAsyncResult *result, gpointer user_da if (!channel) return; DEBUG ("channel %p is ready", channel); - priv = channel->priv; - requested = tp_asv_get_boolean - (tp_channel_borrow_immutable_properties (tp_chan), - TP_IFACE_CHANNEL ".Requested", &valid); - if (valid) - priv->outgoing = requested; + channel->priv->outgoing = tp_channel_get_requested (tp_chan); } void @@ -217,7 +210,6 @@ static void _mcd_channel_setup (McdChannel *channel, McdChannelPrivate *priv) { McdChannel **channel_ptr; - GHashTable *properties; channel_ptr = g_slice_alloc (sizeof (McdChannel *)); *channel_ptr = channel; @@ -227,15 +219,7 @@ _mcd_channel_setup (McdChannel *channel, McdChannelPrivate *priv) g_signal_connect (priv->tp_chan, "invalidated", G_CALLBACK (proxy_destroyed), channel); - properties = tp_channel_borrow_immutable_properties (priv->tp_chan); - if (properties) - { - gboolean requested, valid = FALSE; - requested = tp_asv_get_boolean - (properties, TP_IFACE_CHANNEL ".Requested", &valid); - if (valid) - priv->outgoing = requested; - } + priv->outgoing = tp_channel_get_requested (priv->tp_chan); } static void -- 1.7.10.4