[next] telepathy-glib: remove tp_account_update_parameters_async
Guillaume Desmottes
gdesmott at kemper.freedesktop.org
Thu Feb 27 06:07:34 PST 2014
Module: telepathy-glib
Branch: next
Commit: 08bf88e3c3efe324522f6bf195e780cca200c83c
URL: http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=08bf88e3c3efe324522f6bf195e780cca200c83c
Author: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
Date: Tue Feb 18 15:27:54 2014 +0100
remove tp_account_update_parameters_async
---
.../telepathy-glib/telepathy-glib-sections.txt | 2 -
telepathy-glib/account.c | 78 ++++----------------
telepathy-glib/account.h | 5 --
tests/dbus/account.c | 31 ++------
4 files changed, 20 insertions(+), 96 deletions(-)
diff --git a/docs/reference/telepathy-glib/telepathy-glib-sections.txt b/docs/reference/telepathy-glib/telepathy-glib-sections.txt
index 14bb62a..c2dfaad 100644
--- a/docs/reference/telepathy-glib/telepathy-glib-sections.txt
+++ b/docs/reference/telepathy-glib/telepathy-glib-sections.txt
@@ -3992,8 +3992,6 @@ tp_account_reconnect_async
tp_account_reconnect_finish
tp_account_is_enabled
tp_account_is_usable
-tp_account_update_parameters_async
-tp_account_update_parameters_finish
tp_account_update_parameters_vardict_async
tp_account_update_parameters_vardict_finish
tp_account_remove_async
diff --git a/telepathy-glib/account.c b/telepathy-glib/account.c
index b9551fa..e889bdb 100644
--- a/telepathy-glib/account.c
+++ b/telepathy-glib/account.c
@@ -2708,65 +2708,6 @@ _tp_account_updated_cb (TpAccount *proxy,
}
/**
- * tp_account_update_parameters_async:
- * @account: a #TpAccount
- * @parameters: (element-type utf8 GObject.Value) (transfer none): new
- * parameters to set on @account
- * @unset_parameters: list of parameters to unset on @account
- * @callback: a callback to call when the request is satisfied
- * @user_data: data to pass to @callback
- *
- * Requests an asynchronous update of parameters of @account. When the
- * operation is finished, @callback will be called. You can then call
- * tp_account_update_parameters_finish() to get the result of the operation.
- *
- * Since: 0.9.0
- */
-void
-tp_account_update_parameters_async (TpAccount *account,
- GHashTable *parameters,
- const gchar **unset_parameters,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- GSimpleAsyncResult *result;
-
- g_return_if_fail (TP_IS_ACCOUNT (account));
-
- result = g_simple_async_result_new (G_OBJECT (account),
- callback, user_data, tp_account_update_parameters_finish);
-
- tp_cli_account_call_update_parameters (account, -1, parameters,
- unset_parameters, _tp_account_updated_cb, result,
- NULL, G_OBJECT (account));
-}
-
-/**
- * tp_account_update_parameters_finish:
- * @account: a #TpAccount
- * @result: a #GAsyncResult
- * @reconnect_required: (out) (array zero-terminated=1) (transfer full): a #GStrv to
- * fill with properties that need a reconnect to take effect
- * @error: a #GError to fill
- *
- * Finishes an async update of the parameters on @account.
- *
- * Returns: %TRUE if the request succeeded, otherwise %FALSE
- *
- * Since: 0.9.0
- */
-gboolean
-tp_account_update_parameters_finish (TpAccount *account,
- GAsyncResult *result,
- gchar ***reconnect_required,
- GError **error)
-{
- _tp_implement_finish_copy_pointer (account,
- tp_account_update_parameters_finish, g_strdupv,
- reconnect_required);
-}
-
-/**
* tp_account_update_parameters_vardict_async:
* @account: a #TpAccount
* @parameters: (transfer none): a variant of type %G_VARIANT_TYPE_VARDICT
@@ -2793,14 +2734,22 @@ tp_account_update_parameters_vardict_async (TpAccount *account,
GAsyncReadyCallback callback,
gpointer user_data)
{
+ GSimpleAsyncResult *result;
GHashTable *hash;
+ g_return_if_fail (TP_IS_ACCOUNT (account));
+
hash = _tp_asv_from_vardict (parameters);
+ result = g_simple_async_result_new (G_OBJECT (account),
+ callback, user_data, tp_account_update_parameters_vardict_async);
+
+ tp_cli_account_call_update_parameters (account, -1, hash,
+ unset_parameters, _tp_account_updated_cb, result,
+ NULL, G_OBJECT (account));
+
g_variant_ref_sink (parameters);
- tp_account_update_parameters_async (account, hash,
- unset_parameters, callback, user_data);
g_variant_unref (parameters);
g_hash_table_unref (hash);
}
@@ -2825,9 +2774,10 @@ tp_account_update_parameters_vardict_finish (TpAccount *account,
gchar ***reconnect_required,
GError **error)
{
- /* share an implementation with the non-vardict version */
- return tp_account_update_parameters_finish (account, result,
- reconnect_required, error);
+ _tp_implement_finish_copy_pointer (account,
+ tp_account_update_parameters_vardict_async, g_strdupv,
+ reconnect_required);
+
}
/**
diff --git a/telepathy-glib/account.h b/telepathy-glib/account.h
index 59d1394..579975f 100644
--- a/telepathy-glib/account.h
+++ b/telepathy-glib/account.h
@@ -122,11 +122,6 @@ gboolean tp_account_is_enabled (TpAccount *account);
gboolean tp_account_is_usable (TpAccount *account);
-void tp_account_update_parameters_async (TpAccount *account,
- GHashTable *parameters, const gchar **unset_parameters,
- GAsyncReadyCallback callback, gpointer user_data);
-gboolean tp_account_update_parameters_finish (TpAccount *account,
- GAsyncResult *result, gchar ***reconnect_required, GError **error);
_TP_AVAILABLE_IN_0_18
void tp_account_update_parameters_vardict_async (TpAccount *account,
GVariant *parameters, const gchar **unset_parameters,
diff --git a/tests/dbus/account.c b/tests/dbus/account.c
index edf68aa..ebdc56b 100644
--- a/tests/dbus/account.c
+++ b/tests/dbus/account.c
@@ -277,29 +277,12 @@ test_reconnect (Test *test,
test->account = tp_tests_account_new (test->dbus, ACCOUNT_PATH, NULL);
g_assert (test->account != NULL);
- if (!tp_strdiff (data, "vardict"))
- {
- tp_account_update_parameters_vardict_async (test->account,
- g_variant_new_parsed ("{ 'set': <%s> }", "value"), unset,
- tp_tests_result_ready_cb, &test->result);
- tp_tests_run_until_result (&test->result);
- tp_account_update_parameters_vardict_finish (test->account, test->result,
- &reconnect_required, &test->error);
- }
- else
- {
- GHashTable *set = tp_asv_new (
- "set", G_TYPE_STRING, "value",
- NULL);
-
- tp_account_update_parameters_async (test->account, set, unset,
- tp_tests_result_ready_cb, &test->result);
- tp_tests_run_until_result (&test->result);
- tp_account_update_parameters_finish (test->account, test->result,
- &reconnect_required, &test->error);
-
- g_hash_table_unref (set);
- }
+ tp_account_update_parameters_vardict_async (test->account,
+ g_variant_new_parsed ("{ 'set': <%s> }", "value"), unset,
+ tp_tests_result_ready_cb, &test->result);
+ tp_tests_run_until_result (&test->result);
+ tp_account_update_parameters_vardict_finish (test->account, test->result,
+ &reconnect_required, &test->error);
g_assert_no_error (test->error);
/* check that reconnect_required survives longer than result */
@@ -916,8 +899,6 @@ main (int argc,
g_test_add ("/account/reconnect", Test, NULL, setup_service, test_reconnect,
teardown_service);
- g_test_add ("/account/reconnect", Test, "vardict", setup_service,
- test_reconnect, teardown_service);
g_test_add ("/account/prepare/success", Test, NULL, setup_service,
test_prepare_success, teardown_service);
More information about the telepathy-commits
mailing list