[next] telepathy-glib: Remove deprecated tp_connection_get_contact_list_attributes
Xavier Claessens
xclaesse at kemper.freedesktop.org
Mon May 14 04:28:10 PDT 2012
Module: telepathy-glib
Branch: next
Commit: 826091ea288d7840d3b4727311bf8f2676a3a38d
URL: http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=826091ea288d7840d3b4727311bf8f2676a3a38d
Author: Xavier Claessens <xavier.claessens at collabora.co.uk>
Date: Sat May 12 18:18:15 2012 +0200
Remove deprecated tp_connection_get_contact_list_attributes
---
docs/reference/telepathy-glib-sections.txt | 2 -
telepathy-glib/cli-connection.h | 22 ------
telepathy-glib/connection-handles.c | 108 ----------------------------
tests/dbus/contact-lists.c | 33 ++++++---
4 files changed, 22 insertions(+), 143 deletions(-)
diff --git a/docs/reference/telepathy-glib-sections.txt b/docs/reference/telepathy-glib-sections.txt
index 83d4332..c0237e3 100644
--- a/docs/reference/telepathy-glib-sections.txt
+++ b/docs/reference/telepathy-glib-sections.txt
@@ -3375,8 +3375,6 @@ tp_connection_can_set_contact_alias
<FILE>cli-connection</FILE>
<TITLE>cli-connection</TITLE>
<INCLUDE>telepathy-glib/cli-connection.h</INCLUDE>
-tp_connection_get_contact_attributes
-tp_connection_get_contact_list_attributes
tp_cli_connection_callback_for_connect
tp_cli_connection_call_connect
tp_cli_connection_callback_for_disconnect
diff --git a/telepathy-glib/cli-connection.h b/telepathy-glib/cli-connection.h
index 9980ab3..a7c26ed 100644
--- a/telepathy-glib/cli-connection.h
+++ b/telepathy-glib/cli-connection.h
@@ -26,27 +26,5 @@
#include <telepathy-glib/_gen/tp-cli-connection.h>
-G_BEGIN_DECLS
-
-/* connection-handles.c - this has to come after the auto-generated
- * stuff because it uses an auto-generated typedef */
-
-#ifndef TP_DISABLE_DEPRECATED
-_TP_DEPRECATED_IN_UNRELEASED_FOR(tp_client_factory_ensure_contact)
-void tp_connection_get_contact_attributes (TpConnection *self,
- gint timeout_ms, guint n_handles, const TpHandle *handles,
- const gchar * const *interfaces,
- tp_cli_connection_interface_contacts_callback_for_get_contact_attributes callback,
- gpointer user_data, GDestroyNotify destroy, GObject *weak_object);
-
-_TP_DEPRECATED_IN_UNRELEASED_FOR(tp_connection_dup_contact_list)
-void tp_connection_get_contact_list_attributes (TpConnection *self,
- gint timeout_ms, const gchar * const *interfaces,
- tp_cli_connection_interface_contacts_callback_for_get_contact_attributes callback,
- gpointer user_data, GDestroyNotify destroy, GObject *weak_object);
-#endif
-
-G_END_DECLS
-
#endif
diff --git a/telepathy-glib/connection-handles.c b/telepathy-glib/connection-handles.c
index 9fa121c..4f4c016 100644
--- a/telepathy-glib/connection-handles.c
+++ b/telepathy-glib/connection-handles.c
@@ -195,111 +195,3 @@ tp_connection_request_handles (TpConnection *self,
(const gchar **) context->ids, connection_requested_handles,
context, request_handles_context_free, weak_object);
}
-
-/**
- * tp_connection_get_contact_attributes:
- * @self: a connection
- * @timeout_ms: the timeout in milliseconds, or -1 to use the default
- * @n_handles: the number of handles in @handles (must be at least 1)
- * @handles: (array length=n_handles): an array of handles
- * @interfaces: a #GStrv of interfaces
- * @callback: (type GObject.Callback): called on success or
- * failure (unless @weak_object has become unreferenced)
- * @user_data: arbitrary user-supplied data
- * @destroy: called to destroy @user_data after calling @callback, or when
- * @weak_object becomes unreferenced (whichever occurs sooner)
- * @weak_object: if not %NULL, an object to be weakly referenced: if it is
- * destroyed, @callback will not be called
- *
- * Return (via a callback) any number of attributes of the given handles.
- *
- * This is a thin wrapper around the GetContactAttributes D-Bus
- * method, and should be used in preference to
- * tp_cli_connection_interface_contacts_call_get_contact_attributes();
- * mixing this function and #TpContact with direct use of the
- * RequestHandles, and GetContactAttributes D-Bus methods is
- * unwise. The #TpContact API provides a higher-level abstraction
- * which should usually be used instead.
- *
- * @callback will later be called with the attributes of those of the given
- * handles that were valid. Invalid handles are simply omitted from the
- * parameter to the callback.
- *
- * Deprecated: Use tp_client_factory_ensure_contact() instead.
- */
-void
-tp_connection_get_contact_attributes (TpConnection *self,
- gint timeout_ms,
- guint n_handles,
- const TpHandle *handles,
- const gchar * const *interfaces,
- tp_cli_connection_interface_contacts_callback_for_get_contact_attributes callback,
- gpointer user_data,
- GDestroyNotify destroy,
- GObject *weak_object)
-{
- GArray *a;
- guint i;
-
- DEBUG ("%u handles", n_handles);
-
- for (i = 0; i < n_handles; i++)
- DEBUG ("- %u", handles[i]);
-
- g_return_if_fail (TP_IS_CONNECTION (self));
- g_return_if_fail (n_handles >= 1);
- g_return_if_fail (handles != NULL);
- g_return_if_fail (callback != NULL);
-
- a = g_array_sized_new (FALSE, FALSE, sizeof (guint), n_handles);
-
- g_array_append_vals (a, handles, n_handles);
-
- tp_cli_connection_interface_contacts_call_get_contact_attributes (self, -1,
- a, (const gchar **) interfaces, callback,
- user_data, destroy, weak_object);
- g_array_unref (a);
-}
-
-/**
- * tp_connection_get_contact_list_attributes:
- * @self: a connection
- * @timeout_ms: the timeout in milliseconds (using a large timeout is
- * recommended)
- * @interfaces: a #GStrv of interfaces
- * @callback: (type GObject.Callback): called on success or
- * failure (unless @weak_object has become unreferenced)
- * @user_data: arbitrary user-supplied data
- * @destroy: called to destroy @user_data after calling @callback, or when
- * @weak_object becomes unreferenced (whichever occurs sooner)
- * @weak_object: if not %NULL, an object to be weakly referenced: if it is
- * destroyed, @callback will not be called
- *
- * Return (via a callback) the contacts on the contact list and any number of
- * their attributes.
- *
- * This is a thin wrapper around the RequestContactList D-Bus method,
- * and should be used in preference to lower-level functions; it is similar
- * to tp_connection_get_contact_attributes().
- *
- * The #TpContact API provides a higher-level abstraction which should
- * usually be used instead.
- *
- * Deprecated: Use tp_connection_dup_contact_list() instead.
- */
-void
-tp_connection_get_contact_list_attributes (TpConnection *self,
- gint timeout_ms,
- const gchar * const *interfaces,
- tp_cli_connection_interface_contacts_callback_for_get_contact_attributes callback,
- gpointer user_data,
- GDestroyNotify destroy,
- GObject *weak_object)
-{
- g_return_if_fail (TP_IS_CONNECTION (self));
- g_return_if_fail (callback != NULL);
-
- tp_cli_connection_interface_contact_list_call_get_contact_list_attributes (
- self, -1, (const gchar **) interfaces,
- callback, user_data, destroy, weak_object);
-}
diff --git a/tests/dbus/contact-lists.c b/tests/dbus/contact-lists.c
index 99ad8af..94a4384 100644
--- a/tests/dbus/contact-lists.c
+++ b/tests/dbus/contact-lists.c
@@ -723,13 +723,17 @@ test_assert_contact_state (Test *test,
const gchar *expected_pub_request,
const gchar *expected_group)
{
- const gchar * const interfaces[] = {
+ const gchar *interfaces[] = {
TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST,
TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS,
NULL };
+ GArray *handles;
- tp_connection_get_contact_attributes (test->conn, -1,
- 1, &handle, interfaces, contact_attrs_cb,
+ handles = g_array_new (FALSE, FALSE, sizeof (TpHandle));
+ g_array_append_val (handles, handle);
+
+ tp_cli_connection_interface_contacts_call_get_contact_attributes (test->conn,
+ -1, handles, interfaces, contact_attrs_cb,
test, test_quit_loop, NULL);
g_main_loop_run (test->main_loop);
@@ -737,6 +741,8 @@ test_assert_contact_state (Test *test,
test_assert_contact_list_attrs (test, handle, expected_sub_state,
expected_pub_state, expected_pub_request);
test_assert_contact_groups_attr (test, handle, expected_group);
+
+ g_array_unref (handles);
}
static void
@@ -768,12 +774,12 @@ static void
test_contact_list_attrs (Test *test,
gconstpointer nil G_GNUC_UNUSED)
{
- const gchar * const interfaces[] = {
+ const gchar *interfaces[] = {
TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS,
NULL };
- tp_connection_get_contact_list_attributes (test->conn, -1,
- interfaces, contact_attrs_cb, test, test_quit_loop, NULL);
+ tp_cli_connection_interface_contact_list_call_get_contact_list_attributes (
+ test->conn, -1, interfaces, contact_attrs_cb, test, test_quit_loop, NULL);
g_main_loop_run (test->main_loop);
test_assert_contact_list_attrs (test, test->sjoerd,
@@ -820,18 +826,23 @@ static void
test_contact_blocking_attrs (Test *test,
gconstpointer nil G_GNUC_UNUSED)
{
- const gchar * const interfaces[] = {
+ const gchar *interfaces[] = {
TP_IFACE_CONNECTION_INTERFACE_CONTACT_BLOCKING,
NULL };
- TpHandle handles[] = { test->sjoerd, test->bill };
+ GArray *handles;
- tp_connection_get_contact_attributes (test->conn, -1,
- G_N_ELEMENTS (handles), handles,
- interfaces, contact_attrs_cb, test, test_quit_loop, NULL);
+ handles = g_array_new (FALSE, FALSE, sizeof (TpHandle));
+ g_array_append_val (handles, test->sjoerd);
+ g_array_append_val (handles, test->bill);
+
+ tp_cli_connection_interface_contacts_call_get_contact_attributes (test->conn,
+ -1, handles, interfaces, contact_attrs_cb, test, test_quit_loop, NULL);
g_main_loop_run (test->main_loop);
test_assert_contact_blocking_attrs (test, test->sjoerd, FALSE);
test_assert_contact_blocking_attrs (test, test->bill, TRUE);
+
+ g_array_unref (handles);
}
static void
More information about the telepathy-commits
mailing list