From fbf73e806a8ab6770309d944c0774f0cd7a4c54c Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 14 May 2012 17:06:00 +0100 Subject: [PATCH 01/16] McdConnection: remove virtual methods Now that embedding and old-style plugins have been abolished, nothing can override them. --- src/mcd-connection.c | 19 +++++++++++-------- src/mcd-connection.h | 9 --------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/src/mcd-connection.c b/src/mcd-connection.c index 166f9de..d71c5f5 100644 --- a/src/mcd-connection.c +++ b/src/mcd-connection.c @@ -1171,6 +1171,10 @@ connect_cb (TpConnection *tp_conn, const GError *error, } } +static gboolean +_mcd_connection_request_channel (McdConnection *connection, + McdChannel *channel); + static void request_unrequested_channels (McdConnection *connection) { @@ -1216,6 +1220,9 @@ mcd_connection_find_channel_by_path (McdConnection *connection, return NULL; } +static gboolean mcd_connection_need_dispatch (McdConnection *connection, + const GPtrArray *channels); + static void on_new_channels (TpConnection *proxy, const GPtrArray *channels, gpointer user_data, GObject *weak_object) @@ -1256,8 +1263,7 @@ on_new_channels (TpConnection *proxy, const GPtrArray *channels, * FALSE: they'll also be in Channels in the GetAll(Requests) result */ if (!priv->dispatched_initial_channels) return; - only_observe = ! MCD_CONNECTION_GET_CLASS (connection)->need_dispatch ( - connection, channels); + only_observe = !mcd_connection_need_dispatch (connection, channels); sp_timestamp ("NewChannels received"); for (i = 0; i < channels->len; i++) @@ -2205,7 +2211,8 @@ _mcd_connection_target_handle_is_urgent (McdConnection *self, guint handle) } static gboolean -_mcd_connection_request_channel (McdConnection *connection, McdChannel *channel) +_mcd_connection_request_channel (McdConnection *connection, + McdChannel *channel) { McdConnectionPrivate *priv = MCD_CONNECTION_PRIV (connection); gboolean ret; @@ -2253,9 +2260,6 @@ mcd_connection_class_init (McdConnectionClass * klass) object_class->set_property = _mcd_connection_set_property; object_class->get_property = _mcd_connection_get_property; - klass->need_dispatch = mcd_connection_need_dispatch; - klass->request_channel = _mcd_connection_request_channel; - _mcd_ext_register_dbus_glib_marshallers (); tp_connection_init_known_interfaces (); @@ -2479,8 +2483,7 @@ mcd_connection_request_channel (McdConnection *connection, mcd_operation_take_mission (MCD_OPERATION (connection), MCD_MISSION (channel)); - return MCD_CONNECTION_GET_CLASS (connection)->request_channel (connection, - channel); + return _mcd_connection_request_channel (connection, channel); } void diff --git a/src/mcd-connection.h b/src/mcd-connection.h index 6ea414b..8f450b9 100644 --- a/src/mcd-connection.h +++ b/src/mcd-connection.h @@ -55,15 +55,6 @@ struct _McdConnection struct _McdConnectionClass { McdOperationClass parent_class; - gboolean (*need_dispatch) (McdConnection *connection, - const GPtrArray *channels); - void (*_mc_reserved2) (void); - gboolean (*request_channel) (McdConnection *connection, - McdChannel *channel); - void (*_mc_reserved3) (void); - void (*_mc_reserved4) (void); - void (*_mc_reserved5) (void); - void (*_mc_reserved6) (void); }; #include "mcd-dispatcher.h" -- 1.7.10.4