From 98b700ac52fcb4322715b458c64769b1f3e8a34e Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Fri, 28 Feb 2014 13:15:31 +0100 Subject: [PATCH 1/3] handle-channel-context: replace get_handler_info by a GVariant version --- .../telepathy-glib/telepathy-glib-sections.txt | 2 +- telepathy-glib/account-channel-request.c | 4 ++-- telepathy-glib/handle-channel-context.c | 18 +++++++----------- telepathy-glib/handle-channel-context.h | 2 +- 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/docs/reference/telepathy-glib/telepathy-glib-sections.txt b/docs/reference/telepathy-glib/telepathy-glib-sections.txt index ae071c7..54f7fff 100644 --- a/docs/reference/telepathy-glib/telepathy-glib-sections.txt +++ b/docs/reference/telepathy-glib/telepathy-glib-sections.txt @@ -4665,7 +4665,7 @@ TpHandleChannelContext tp_handle_channel_context_accept tp_handle_channel_context_delay tp_handle_channel_context_fail -tp_handle_channel_context_get_handler_info +tp_handle_channel_context_dup_handler_info tp_handle_channel_context_get_requests tp_handle_channel_context_get_type diff --git a/telepathy-glib/account-channel-request.c b/telepathy-glib/account-channel-request.c index 6f48655..9b9fe20 100644 --- a/telepathy-glib/account-channel-request.c +++ b/telepathy-glib/account-channel-request.c @@ -456,7 +456,7 @@ tp_account_channel_request_class_init ( * @user_action_time, and if appropriate, moving to the foreground. * * @context can be used to obtain extensible information about the channel - * via tp_handle_channel_context_get_handler_info(), and any similar methods + * via tp_handle_channel_context_dup_handler_info(), and any similar methods * that are added in future. It is not valid for the receiver of this signal * to call tp_handle_channel_context_accept(), * tp_handle_channel_context_delay() or tp_handle_channel_context_fail(). @@ -1144,7 +1144,7 @@ tp_account_channel_request_ensure_and_handle_channel_async ( * will fail with the error %TP_ERROR_NOT_YOURS. * * @context can be used to obtain extensible information about the channel - * via tp_handle_channel_context_get_handler_info(), and any similar methods + * via tp_handle_channel_context_dup_handler_info(), and any similar methods * that are added in future. It is not valid for the caller of this method * to call tp_handle_channel_context_accept(), * tp_handle_channel_context_delay() or tp_handle_channel_context_fail(). diff --git a/telepathy-glib/handle-channel-context.c b/telepathy-glib/handle-channel-context.c index 1b38424..9834357 100644 --- a/telepathy-glib/handle-channel-context.c +++ b/telepathy-glib/handle-channel-context.c @@ -57,6 +57,7 @@ #include #include #include +#include #define DEBUG_FLAG TP_DEBUG_CLIENT #include "telepathy-glib/debug-internal.h" @@ -673,7 +674,7 @@ _tp_handle_channel_context_prepare_finish ( } /** - * tp_handle_channel_context_get_handler_info: + * tp_handle_channel_context_dup_handler_info: * @self: a channel-handling context * * Return any extra information that accompanied this request to handle @@ -681,19 +682,14 @@ _tp_handle_channel_context_prepare_finish ( * Well-known keys for this map will be defined by the Telepathy D-Bus * Interface Specification; at the time of writing, none have been defined. * - * The returned hash table is only valid for as long as @self is. - * - * Returns: (transfer none) (element-type utf8 GObject.Value): extensible - * extra handler information, in a form suitable for use with - * tp_asv_get_string() etc. - * - * Since: 0.11.14 + * Returns: (transfer full): a #G_VARIANT_TYPE_VARDICT #Gvariant containing the + * extra handler information. */ -const GHashTable * -tp_handle_channel_context_get_handler_info (TpHandleChannelContext *self) +GVariant * +tp_handle_channel_context_dup_handler_info (TpHandleChannelContext *self) { g_return_val_if_fail (TP_IS_HANDLE_CHANNELS_CONTEXT (self), NULL); - return self->handler_info; + return tp_asv_to_vardict (self->handler_info); } /** diff --git a/telepathy-glib/handle-channel-context.h b/telepathy-glib/handle-channel-context.h index 476c0fc..320d152 100644 --- a/telepathy-glib/handle-channel-context.h +++ b/telepathy-glib/handle-channel-context.h @@ -64,7 +64,7 @@ void tp_handle_channel_context_fail ( void tp_handle_channel_context_delay ( TpHandleChannelContext *self); -const GHashTable *tp_handle_channel_context_get_handler_info ( +GVariant * tp_handle_channel_context_dup_handler_info ( TpHandleChannelContext *self); GList * tp_handle_channel_context_get_requests ( -- 1.8.5.3