[next] telepathy-glib: Remove deprecated tp_list_connection_managers()

Xavier Claessens xclaesse at kemper.freedesktop.org
Tue Jun 26 03:21:32 PDT 2012


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

Author: Xavier Claessens <xavier.claessens at collabora.co.uk>
Date:   Tue Jun  5 11:58:56 2012 +0200

Remove deprecated tp_list_connection_managers()

---

 docs/reference/telepathy-glib-sections.txt |    2 -
 telepathy-glib/connection-manager.c        |   57 +++------------------
 telepathy-glib/connection-manager.h        |   12 ----
 tests/dbus/cm.c                            |   77 +++++++---------------------
 4 files changed, 26 insertions(+), 122 deletions(-)

diff --git a/docs/reference/telepathy-glib-sections.txt b/docs/reference/telepathy-glib-sections.txt
index 7dc76f0..24496d4 100644
--- a/docs/reference/telepathy-glib-sections.txt
+++ b/docs/reference/telepathy-glib-sections.txt
@@ -3616,10 +3616,8 @@ tp_cli_connection_interface_addressing_callback_for_get_contacts_by_vcard_field
 <FILE>connection-manager</FILE>
 <TITLE>connection-manager</TITLE>
 <INCLUDE>telepathy-glib/telepathy-glib.h</INCLUDE>
-TpConnectionManagerListCb
 tp_list_connection_managers_async
 tp_list_connection_managers_finish
-tp_list_connection_managers
 TpConnectionManager
 TpConnectionManagerClass
 tp_connection_manager_new
diff --git a/telepathy-glib/connection-manager.c b/telepathy-glib/connection-manager.c
index 3d7876c..6d9f182 100644
--- a/telepathy-glib/connection-manager.c
+++ b/telepathy-glib/connection-manager.c
@@ -53,29 +53,6 @@
  */
 
 /**
- * TpConnectionManagerListCb:
- * @cms: (array zero-terminated=1): %NULL-terminated array of
- *   #TpConnectionManager (the objects will
- *   be unreferenced and the array will be freed after the callback returns,
- *   so the callback must reference any CMs it stores a pointer to),
- *   or %NULL on error
- * @n_cms: number of connection managers in @cms (not including the final
- *  %NULL)
- * @error: %NULL on success, or an error that occurred
- * @user_data: user-supplied data
- * @weak_object: user-supplied weakly referenced object
- *
- * Signature of the callback supplied to tp_list_connection_managers().
- *
- * Since 0.11.3, tp_list_connection_managers() will
- * wait for %TP_CONNECTION_MANAGER_FEATURE_CORE to be prepared on each
- * connection manager passed to @callback, unless an error occurred while
- * launching that connection manager.
- *
- * Since: 0.7.1
- */
-
-/**
  * TP_CONNECTION_MANAGER_FEATURE_CORE:
  *
  * Expands to a call to a function that returns a quark for the "core" feature
@@ -1361,6 +1338,12 @@ steal_into_ptr_array (gpointer key,
   return TRUE;
 }
 
+typedef void (*TpConnectionManagerListCb) (TpConnectionManager * const *cms,
+    gsize n_cms,
+    const GError *error,
+    gpointer user_data,
+    GObject *weak_object);
+
 typedef struct
 {
   GHashTable *table;
@@ -1517,31 +1500,7 @@ tp_list_connection_managers_got_names (TpDBusDaemon *bus_daemon,
     }
 }
 
-/**
- * tp_list_connection_managers:
- * @bus_daemon: proxy for the D-Bus daemon
- * @callback: callback to be called when listing the CMs
- *  succeeds or fails; not called if the @weak_object goes away
- * @user_data: user-supplied data for the callback
- * @destroy: callback to destroy the user-supplied data, called after
- *   @callback, but also if the @weak_object goes away
- * @weak_object: (allow-none): if not %NULL, will be weakly
- *  referenced; the callback will not be called, and the call will be
- *  cancelled, if the object has vanished
- *
- * List the available (running or installed) connection managers. Call the
- * callback when done.
- *
- * Since 0.7.26, this function will wait for each #TpConnectionManager
- * to be ready, so all connection managers passed to @callback will have
- * their %TP_CONNECTION_MANAGER_FEATURE_CORE feature prepared, unless an error
- * occurred while launching that connection manager.
- *
- * Since: 0.7.1
- *
- * Deprecated: since 0.19.1, use tp_list_connection_managers_async()
- */
-void
+static void
 tp_list_connection_managers (TpDBusDaemon *bus_daemon,
                              TpConnectionManagerListCb callback,
                              gpointer user_data,
@@ -1643,10 +1602,8 @@ tp_list_connection_managers_async (TpDBusDaemon *dbus_daemon,
     }
   else
     {
-      G_GNUC_BEGIN_IGNORE_DEPRECATIONS
       tp_list_connection_managers (dbus_daemon,
           list_connection_managers_async_cb, result, g_object_unref, NULL);
-      G_GNUC_END_IGNORE_DEPRECATIONS
       g_object_unref (dbus_daemon);
     }
 }
diff --git a/telepathy-glib/connection-manager.h b/telepathy-glib/connection-manager.h
index 621bf9a..07b6cea 100644
--- a/telepathy-glib/connection-manager.h
+++ b/telepathy-glib/connection-manager.h
@@ -112,18 +112,6 @@ TpConnectionManager *tp_connection_manager_new (TpDBusDaemon *dbus,
 
 gboolean tp_connection_manager_activate (TpConnectionManager *self);
 
-typedef void (*TpConnectionManagerListCb) (TpConnectionManager * const *cms,
-    gsize n_cms, const GError *error, gpointer user_data,
-    GObject *weak_object);
-
-#ifndef TP_DISABLE_DEPRECATED
-_TP_DEPRECATED_IN_0_20_FOR (tp_list_connection_managers_async)
-void tp_list_connection_managers (TpDBusDaemon *bus_daemon,
-    TpConnectionManagerListCb callback,
-    gpointer user_data, GDestroyNotify destroy,
-    GObject *weak_object);
-#endif
-
 _TP_AVAILABLE_IN_0_18
 void tp_list_connection_managers_async (TpDBusDaemon *dbus_daemon,
     GAsyncReadyCallback callback,
diff --git a/tests/dbus/cm.c b/tests/dbus/cm.c
index 9e687e0..38ac247 100644
--- a/tests/dbus/cm.c
+++ b/tests/dbus/cm.c
@@ -18,7 +18,6 @@
 
 typedef enum {
     ACTIVATE_CM = (1 << 0),
-    USE_OLD_LIST = (1 << 1)
 } TestFlags;
 
 typedef struct {
@@ -847,71 +846,35 @@ test_dbus_ready (Test *test,
 }
 
 static void
-on_listed_connection_managers (TpConnectionManager * const * cms,
-                               gsize n_cms,
-                               const GError *error,
-                               gpointer user_data,
-                               GObject *weak_object G_GNUC_UNUSED)
-{
-  Test *test = user_data;
-
-  g_assert_cmpuint ((guint) n_cms, ==, 2);
-  g_assert (cms[2] == NULL);
-
-  if (tp_connection_manager_is_running (cms[0]))
-    {
-      test->echo = g_object_ref (cms[0]);
-      test->spurious = g_object_ref (cms[1]);
-    }
-  else
-    {
-      test->spurious = g_object_ref (cms[0]);
-      test->echo = g_object_ref (cms[1]);
-    }
-
-  g_main_loop_quit (test->mainloop);
-}
-
-static void
 test_list (Test *test,
            gconstpointer data)
 {
-  TestFlags flags = GPOINTER_TO_INT (data);
+  GAsyncResult *res = NULL;
+  GList *cms;
+
+  tp_list_connection_managers_async (test->dbus, tp_tests_result_ready_cb,
+      &res);
+  tp_tests_run_until_result (&res);
 
-  if (flags & USE_OLD_LIST)
+  cms = tp_list_connection_managers_finish (res, &test->error);
+  g_assert_no_error (test->error);
+  g_assert_cmpuint (g_list_length (cms), ==, 2);
+
+  /* transfer ownership */
+  if (tp_connection_manager_is_running (cms->data))
     {
-      tp_list_connection_managers (test->dbus, on_listed_connection_managers,
-          test, NULL, NULL);
-      g_main_loop_run (test->mainloop);
+      test->echo = cms->data;
+      test->spurious = cms->next->data;
     }
   else
     {
-      GAsyncResult *res = NULL;
-      GList *cms;
-
-      tp_list_connection_managers_async (test->dbus, tp_tests_result_ready_cb,
-          &res);
-      tp_tests_run_until_result (&res);
-      cms = tp_list_connection_managers_finish (res, &test->error);
-      g_assert_no_error (test->error);
-      g_assert_cmpuint (g_list_length (cms), ==, 2);
-
-      /* transfer ownership */
-      if (tp_connection_manager_is_running (cms->data))
-        {
-          test->echo = cms->data;
-          test->spurious = cms->next->data;
-        }
-      else
-        {
-          test->spurious = cms->data;
-          test->echo = cms->next->data;
-        }
-
-      g_object_unref (res);
-      g_list_free (cms);
+      test->spurious = cms->data;
+      test->echo = cms->next->data;
     }
 
+  g_object_unref (res);
+  g_list_free (cms);
+
   g_assert (tp_connection_manager_is_running (test->echo));
   g_assert (!tp_connection_manager_is_running (test->spurious));
 
@@ -961,8 +924,6 @@ main (int argc,
 
   g_test_add ("/cm/list", Test, GINT_TO_POINTER (0),
       setup, test_list, teardown);
-  g_test_add ("/cm/list", Test, GINT_TO_POINTER (USE_OLD_LIST),
-      setup, test_list, teardown);
 
   return g_test_run ();
 }



More information about the telepathy-commits mailing list