]> git.0d.be Git - empathy.git/commitdiff
remove empathy_dispatcher_find_requestable_channel_classes_async (#632550)
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 19 Oct 2010 12:53:39 +0000 (14:53 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 20 Oct 2010 07:09:00 +0000 (09:09 +0200)
libempathy/empathy-dispatcher.c
libempathy/empathy-dispatcher.h

index 2a009b34a268e992f80ad9a2ae0c25f2f9bb8181..5587677510c573640a9931ba95535c5e30bb32a4 100644 (file)
@@ -59,7 +59,6 @@ typedef struct
   GHashTable *connections;
   GHashTable *outstanding_classes_requests;
 
-  GHashTable *request_channel_class_async_ids;
   /* reffed (TpAccount *) => gulong
    * Signal handler ID of the "status-changed" signal */
   GHashTable *status_changed_handlers;
@@ -262,17 +261,6 @@ dispatcher_status_changed_cb (TpAccount *account,
     dispatcher_init_connection_if_needed (self, conn);
 }
 
-static void
-remove_idle_handlers (gpointer key,
-                      gpointer value,
-                      gpointer user_data)
-{
-  guint source_id;
-
-  source_id = GPOINTER_TO_UINT (value);
-  g_source_remove (source_id);
-}
-
 static GObject *
 dispatcher_constructor (GType type,
                         guint n_construct_params,
@@ -329,13 +317,6 @@ dispatcher_finalize (GObject *object)
   GList *list;
   gpointer account, id;
 
-  if (priv->request_channel_class_async_ids != NULL)
-    {
-      g_hash_table_foreach (priv->request_channel_class_async_ids,
-        remove_idle_handlers, NULL);
-      g_hash_table_destroy (priv->request_channel_class_async_ids);
-    }
-
   g_hash_table_iter_init (&iter, priv->outstanding_classes_requests);
   while (g_hash_table_iter_next (&iter, &connection, (gpointer *) &list))
     {
@@ -473,8 +454,6 @@ empathy_dispatcher_init (EmpathyDispatcher *self)
       "account-validity-changed", G_CALLBACK (account_validity_changed_cb),
       self, 0);
 
-  priv->request_channel_class_async_ids = g_hash_table_new (g_direct_hash,
-    g_direct_equal);
   priv->status_changed_handlers = g_hash_table_new_full (NULL, NULL,
       (GDestroyNotify) g_object_unref, NULL);
 }
@@ -679,48 +658,6 @@ empathy_dispatcher_find_channel_classes (EmpathyDispatcher *self,
   return matching_classes;
 }
 
-static gboolean
-find_channel_class_idle_cb (gpointer user_data)
-{
-  GList *retval;
-  GList *requests;
-  FindChannelRequest *request = user_data;
-  ConnectionData *cd;
-  gboolean is_ready = TRUE;
-  EmpathyDispatcherPriv *priv = GET_PRIV (request->dispatcher);
-
-  g_hash_table_remove (priv->request_channel_class_async_ids, request);
-
-  cd = g_hash_table_lookup (priv->connections, request->connection);
-
-  if (cd == NULL)
-    is_ready = FALSE;
-  else if (cd->requestable_channels == NULL)
-    is_ready = FALSE;
-
-  if (is_ready)
-    {
-      retval = empathy_dispatcher_find_channel_classes (request->dispatcher,
-          request->connection, request->channel_type, request->handle_type,
-          request->properties);
-
-      request->callback (retval, request->user_data);
-      free_find_channel_request (request);
-      g_list_free (retval);
-
-      return FALSE;
-    }
-
-  requests = g_hash_table_lookup (priv->outstanding_classes_requests,
-      request->connection);
-  requests = g_list_prepend (requests, request);
-
-  g_hash_table_insert (priv->outstanding_classes_requests,
-      request->connection, requests);
-
-  return FALSE;
-}
-
 static GArray *
 setup_varargs (va_list var_args,
                const char *channel_namespace,
@@ -822,64 +759,3 @@ empathy_dispatcher_find_requestable_channel_classes
 
   return retval;
 }
-
-/**
- * empathy_dispatcher_find_requestable_channel_classes_async:
- * @dispatcher: an #EmpathyDispatcher
- * @connection: a #TpConnection
- * @channel_type: a string identifying the type of the channel to lookup
- * @handle_type: the handle type for the channel
- * @callback: the callback to call when @connection is ready
- * @user_data: the user data to pass to @callback
- * @first_property_name: %NULL, or the name of the first fixed property,
- * followed optionally by more names, followed by %NULL.
- *
- * Please see the documentation of
- * empathy_dispatcher_find_requestable_channel_classes() for a detailed
- * description of this function.
- */
-void
-empathy_dispatcher_find_requestable_channel_classes_async
-                                 (EmpathyDispatcher *self,
-                                  TpConnection *connection,
-                                  const gchar *channel_type,
-                                  guint handle_type,
-                                  EmpathyDispatcherFindChannelClassCb callback,
-                                  gpointer user_data,
-                                  const char *first_property_name,
-                                  ...)
-{
-  va_list var_args;
-  GArray *properties;
-  FindChannelRequest *request;
-  EmpathyDispatcherPriv *priv;
-  guint source_id;
-
-  g_return_if_fail (EMPATHY_IS_DISPATCHER (self));
-  g_return_if_fail (TP_IS_CONNECTION (connection));
-  g_return_if_fail (channel_type != NULL);
-  g_return_if_fail (handle_type != 0);
-
-  priv = GET_PRIV (self);
-
-  va_start (var_args, first_property_name);
-
-  properties = setup_varargs (var_args, channel_type, first_property_name);
-
-  va_end (var_args);
-
-  /* append another request for this connection */
-  request = g_slice_new0 (FindChannelRequest);
-  request->dispatcher = g_object_ref (self);
-  request->channel_type = g_strdup (channel_type);
-  request->handle_type = handle_type;
-  request->connection = connection;
-  request->callback = callback;
-  request->user_data = user_data;
-  request->properties = properties;
-
-  source_id = g_idle_add (find_channel_class_idle_cb, request);
-
-  g_hash_table_insert (priv->request_channel_class_async_ids,
-    request, GUINT_TO_POINTER (source_id));
-}
index cd54fa5d1cdba715a2c33f6192c467f2b3ee3aa7..2f786db7aa6604a413eada4fa45ed8c16f43c2ea 100644 (file)
@@ -70,12 +70,6 @@ void empathy_dispatcher_join_muc (TpAccount *account,
   const gchar *roomname,
   gint64 timestamp);
 
-void empathy_dispatcher_find_requestable_channel_classes_async
-    (EmpathyDispatcher *dispatcher, TpConnection *connection,
-     const gchar *channel_type, guint handle_type,
-     EmpathyDispatcherFindChannelClassCb callback, gpointer user_data,
-     const char *first_property_name, ...);
-
 GList * empathy_dispatcher_find_requestable_channel_classes
     (EmpathyDispatcher *dispatcher, TpConnection *connection,
      const gchar *channel_type, guint handle_type,