From e5f1b9ae3ff61e5a4ed0dca4576879744032233c Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Wed, 11 Aug 2010 17:22:46 +0200 Subject: dispatcher: remove more unused attributes and code --- libempathy/empathy-dispatcher.c | 75 +---------------------------------------- 1 file changed, 1 insertion(+), 74 deletions(-) (limited to 'libempathy') diff --git a/libempathy/empathy-dispatcher.c b/libempathy/empathy-dispatcher.c index 55dfcf074..2a009b34a 100644 --- a/libempathy/empathy-dispatcher.c +++ b/libempathy/empathy-dispatcher.c @@ -31,15 +31,11 @@ #include #include #include -#include -#include #include #include #include #include #include -#include -#include #include #include @@ -62,19 +58,11 @@ typedef struct /* connection to connection data mapping */ GHashTable *connections; GHashTable *outstanding_classes_requests; - gpointer token; - - /* channels which the dispatcher is listening "invalidated" */ - GList *channels; - GPtrArray *array; GHashTable *request_channel_class_async_ids; /* reffed (TpAccount *) => gulong * Signal handler ID of the "status-changed" signal */ GHashTable *status_changed_handlers; - - TpChannelDispatcher *channel_dispatcher; - TpDBusDaemon *dbus; } EmpathyDispatcherPriv; G_DEFINE_TYPE (EmpathyDispatcher, empathy_dispatcher, G_TYPE_OBJECT); @@ -98,9 +86,6 @@ typedef struct typedef struct { - /* ObjectPath -> EmpathyDispatchOperations */ - GHashTable *dispatching_channels; - /* List of requestable channel classes */ GPtrArray *requestable_channels; } ConnectionData; @@ -119,12 +104,7 @@ typedef struct static ConnectionData * new_connection_data (void) { - ConnectionData *cd = g_slice_new0 (ConnectionData); - - cd->dispatching_channels = g_hash_table_new_full (g_str_hash, g_str_equal, - g_free, g_object_unref); - - return cd; + return g_slice_new0 (ConnectionData); } static void @@ -132,8 +112,6 @@ free_connection_data (ConnectionData *cd) { guint i; - g_hash_table_destroy (cd->dispatching_channels); - if (cd->requestable_channels != NULL) { for (i = 0 ; i < cd->requestable_channels->len ; i++) @@ -180,35 +158,6 @@ dispatcher_connection_invalidated_cb (TpConnection *connection, g_hash_table_remove (priv->connections, connection); } -static void -dispatcher_channel_invalidated_cb (TpProxy *proxy, - guint domain, - gint code, - gchar *message, - EmpathyDispatcher *self) -{ - /* Channel went away... */ - EmpathyDispatcherPriv *priv = GET_PRIV (self); - TpConnection *connection; - ConnectionData *cd; - const gchar *object_path; - - connection = tp_channel_borrow_connection (TP_CHANNEL (proxy)); - - priv->channels = g_list_remove (priv->channels, proxy); - - cd = g_hash_table_lookup (priv->connections, connection); - /* Connection itself invalidated? */ - if (cd == NULL) - return; - - object_path = tp_proxy_get_object_path (proxy); - - DEBUG ("Channel %s invalidated", object_path); - - g_hash_table_remove (cd->dispatching_channels, object_path); -} - static void got_connection_rcc (EmpathyDispatcher *self, TpConnection *connection) @@ -368,14 +317,6 @@ dispatcher_dispose (GObject *object) g_hash_table_destroy (priv->connections); priv->connections = NULL; - if (priv->channel_dispatcher != NULL) - g_object_unref (priv->channel_dispatcher); - priv->channel_dispatcher = NULL; - - if (priv->dbus != NULL) - g_object_unref (priv->dbus); - priv->dbus = NULL; - G_OBJECT_CLASS (empathy_dispatcher_parent_class)->dispose (object); } @@ -383,7 +324,6 @@ static void dispatcher_finalize (GObject *object) { EmpathyDispatcherPriv *priv = GET_PRIV (object); - GList *l; GHashTableIter iter; gpointer connection; GList *list; @@ -396,14 +336,6 @@ dispatcher_finalize (GObject *object) g_hash_table_destroy (priv->request_channel_class_async_ids); } - for (l = priv->channels; l; l = l->next) - { - g_signal_handlers_disconnect_by_func (l->data, - dispatcher_channel_invalidated_cb, object); - } - - g_list_free (priv->channels); - g_hash_table_iter_init (&iter, priv->outstanding_classes_requests); while (g_hash_table_iter_next (&iter, &connection, (gpointer *) &list)) { @@ -534,8 +466,6 @@ empathy_dispatcher_init (EmpathyDispatcher *self) priv->outstanding_classes_requests = g_hash_table_new_full (g_direct_hash, g_direct_equal, g_object_unref, NULL); - priv->channels = NULL; - tp_account_manager_prepare_async (priv->account_manager, NULL, account_manager_prepared_cb, self); @@ -547,9 +477,6 @@ empathy_dispatcher_init (EmpathyDispatcher *self) g_direct_equal); priv->status_changed_handlers = g_hash_table_new_full (NULL, NULL, (GDestroyNotify) g_object_unref, NULL); - - priv->dbus = tp_dbus_daemon_dup (NULL); - priv->channel_dispatcher = tp_channel_dispatcher_new (priv->dbus); } EmpathyDispatcher * -- cgit v1.2.3