[next] telepathy-glib: Remove tp_channel_dispatch_operation_claim_async

Simon McVittie smcv at kemper.freedesktop.org
Thu May 3 07:34:44 PDT 2012


Module: telepathy-glib
Branch: next
Commit: bfa20b72df48c903a1c86327d3cf1b9deb5f9e11
URL:    http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=bfa20b72df48c903a1c86327d3cf1b9deb5f9e11

Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Thu May  3 13:57:38 2012 +0100

Remove tp_channel_dispatch_operation_claim_async

---

 docs/reference/telepathy-glib-sections.txt  |    2 -
 telepathy-glib/channel-dispatch-operation.c |   88 +--------------------------
 telepathy-glib/channel-dispatch-operation.h |   10 ---
 tests/dbus/channel-dispatch-operation.c     |   35 +----------
 4 files changed, 5 insertions(+), 130 deletions(-)

diff --git a/docs/reference/telepathy-glib-sections.txt b/docs/reference/telepathy-glib-sections.txt
index 971c49e..c4142fc 100644
--- a/docs/reference/telepathy-glib-sections.txt
+++ b/docs/reference/telepathy-glib-sections.txt
@@ -4257,8 +4257,6 @@ tp_channel_dispatch_operation_handle_with_async
 tp_channel_dispatch_operation_handle_with_finish
 tp_channel_dispatch_operation_handle_with_time_async
 tp_channel_dispatch_operation_handle_with_time_finish
-tp_channel_dispatch_operation_claim_async
-tp_channel_dispatch_operation_claim_finish
 tp_channel_dispatch_operation_claim_with_async
 tp_channel_dispatch_operation_claim_with_finish
 tp_channel_dispatch_operation_close_channels_async
diff --git a/telepathy-glib/channel-dispatch-operation.c b/telepathy-glib/channel-dispatch-operation.c
index e261c24..1d6799c 100644
--- a/telepathy-glib/channel-dispatch-operation.c
+++ b/telepathy-glib/channel-dispatch-operation.c
@@ -71,7 +71,7 @@
  *
  * If the user wishes to reject the communication channels, or if the user
  * accepts the channels and the approver will handle them itself, the approver
- * should call tp_cli_channel_dispatch_operation_call_claim(). If this method
+ * should call tp_channel_dispatch_operation_claim_with_async(). If this method
  * succeeds, the approver immediately has control over the channels as their
  * primary handler, and may do anything with them (in particular, it may close
  * them in whatever way seems most appropriate).
@@ -1104,7 +1104,7 @@ handle_with_cb (TpChannelDispatchOperation *self,
  * invoked as the handler.
  *
  * Approvers which are also channel handlers SHOULD use
- * tp_channel_dispatch_operation_claim_async() instead
+ * tp_channel_dispatch_operation_claim_with_async() instead
  * of tp_channel_dispatch_operation_handle_with_async() to request
  * that they can handle a channel bundle themselves.
  *
@@ -1151,87 +1151,6 @@ tp_channel_dispatch_operation_handle_with_finish (
       tp_channel_dispatch_operation_handle_with_async);
 }
 
-static void
-claim_cb (TpChannelDispatchOperation *self,
-    const GError *error,
-    gpointer user_data,
-    GObject *weak_object)
-{
-  GSimpleAsyncResult *result = user_data;
-
-  if (error != NULL)
-    {
-      DEBUG ("Claim failed: %s", error->message);
-      g_simple_async_result_set_from_error (result, error);
-    }
-
-  g_simple_async_result_complete (result);
-  g_object_unref (result);
-}
-
-/**
- * tp_channel_dispatch_operation_claim_async:
- * @self: a #TpChannelDispatchOperation
- * @callback: a callback to call when the call returns
- * @user_data: data to pass to @callback
- *
- * Called by an approver to claim channels for handling internally.
- * If this method is called successfully, the process calling this
- * method becomes the handler for the channel.
- *
- * If successful, this method will cause the #TpProxy::invalidated signal
- * to be emitted, in the same way as for
- * tp_channel_dispatch_operation_handle_with_async().
- *
- * This method may fail because the dispatch operation has already
- * been completed. Again, see tp_channel_dispatch_operation_handle_with_async()
- * for more details. The approver MUST NOT attempt to interact with
- * the channels further in this case.
- *
- * Since: 0.11.5
- * Deprecated: since 0.15.0. Use
- * tp_channel_dispatch_operation_claim_with_async()
- */
-void
-tp_channel_dispatch_operation_claim_async (
-    TpChannelDispatchOperation *self,
-    GAsyncReadyCallback callback,
-    gpointer user_data)
-{
-  GSimpleAsyncResult *result;
-
-  g_return_if_fail (TP_IS_CHANNEL_DISPATCH_OPERATION (self));
-
-  result = g_simple_async_result_new (G_OBJECT (self),
-      callback, user_data, tp_channel_dispatch_operation_claim_async);
-
-  tp_cli_channel_dispatch_operation_call_claim (self, -1,
-      claim_cb, result, NULL, G_OBJECT (self));
-}
-
-/**
- * tp_channel_dispatch_operation_claim_finish:
- * @self: a #TpChannelDispatchOperation
- * @result: a #GAsyncResult
- * @error: a #GError to fill
- *
- * Finishes an async call to Claim().
- *
- * Returns: %TRUE if the Claim() call was successful, otherwise %FALSE
- *
- * Since: 0.11.5
- * Deprecated: since 0.15.0. Use
- * tp_channel_dispatch_operation_claim_with_finish()
- */
-gboolean
-tp_channel_dispatch_operation_claim_finish (
-    TpChannelDispatchOperation *self,
-    GAsyncResult *result,
-    GError **error)
-{
-  _tp_implement_finish_void (self, tp_channel_dispatch_operation_claim_async);
-}
-
 /* FIXME: This is temporary solution to share TpChannel objects until
  * TpClientFactory can be used for that */
 void
@@ -1361,9 +1280,6 @@ claim_with_cb (TpChannelDispatchOperation *self,
  * for more details. The approver MUST NOT attempt to interact with
  * the channels further in this case.
  *
- * This is an improved version of tp_channel_dispatch_operation_claim_async()
- * as it tells @client about the new channels being handled.
- *
  * %TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE feature must be prepared before
  * calling this function.
  *
diff --git a/telepathy-glib/channel-dispatch-operation.h b/telepathy-glib/channel-dispatch-operation.h
index 2ccf8df..fe8c38d 100644
--- a/telepathy-glib/channel-dispatch-operation.h
+++ b/telepathy-glib/channel-dispatch-operation.h
@@ -109,16 +109,6 @@ gboolean tp_channel_dispatch_operation_handle_with_finish (
     GAsyncResult *result,
     GError **error);
 
-void tp_channel_dispatch_operation_claim_async (
-    TpChannelDispatchOperation *self,
-    GAsyncReadyCallback callback,
-    gpointer user_data);
-
-gboolean tp_channel_dispatch_operation_claim_finish (
-    TpChannelDispatchOperation *self,
-    GAsyncResult *result,
-    GError **error);
-
 void tp_channel_dispatch_operation_handle_with_time_async (
     TpChannelDispatchOperation *self,
     const gchar *handler,
diff --git a/tests/dbus/channel-dispatch-operation.c b/tests/dbus/channel-dispatch-operation.c
index f30ed7e..5a66437 100644
--- a/tests/dbus/channel-dispatch-operation.c
+++ b/tests/dbus/channel-dispatch-operation.c
@@ -633,36 +633,6 @@ test_handle_with (Test *test,
 }
 
 static void
-claim_cb (GObject *source,
-    GAsyncResult *result,
-    gpointer user_data)
-{
-  Test *test = user_data;
-
-  tp_channel_dispatch_operation_claim_finish (
-      TP_CHANNEL_DISPATCH_OPERATION (source), result, &test->error);
-
-  g_main_loop_quit (test->mainloop);
-}
-
-static void
-test_claim (Test *test,
-    gconstpointer data G_GNUC_UNUSED)
-{
-  test->cdo = tp_channel_dispatch_operation_new (test->dbus,
-      "/whatever", NULL, &test->error);
-  g_assert_no_error (test->error);
-
-  tp_channel_dispatch_operation_claim_async (test->cdo, claim_cb, test);
-  g_main_loop_run (test->mainloop);
-
-  g_assert_no_error (test->error);
-
-  /* tp_channel_dispatch_operation_claim_with_async() is tested in
-   * tests/dbus/base-client.c */
-}
-
-static void
 test_channel_lost_preparing (Test *test,
     gconstpointer data G_GNUC_UNUSED)
 {
@@ -931,8 +901,6 @@ main (int argc,
       test_channel_lost, teardown_services);
   g_test_add ("/cdo/handle-with", Test, NULL, setup_services,
       test_handle_with, teardown_services);
-  g_test_add ("/cdo/claim", Test, NULL, setup_services,
-      test_claim, teardown_services);
   g_test_add ("/cdo/channel-lost-preparing", Test, NULL, setup_services,
       test_channel_lost_preparing, teardown_services);
   g_test_add ("/cdo/finished--preparing", Test, NULL, setup_services,
@@ -946,5 +914,8 @@ main (int argc,
   g_test_add ("/cdo/destroy-channels", Test, NULL, setup_services,
       test_destroy_channels, teardown_services);
 
+  /* tp_channel_dispatch_operation_claim_with_async() is tested in
+   * tests/dbus/base-client.c */
+
   return g_test_run ();
 }



More information about the telepathy-commits mailing list