diff options
author | Jens Georg <mail@jensge.org> | 2013-04-01 15:15:09 +0200 |
---|---|---|
committer | Jens Georg <mail@jensge.org> | 2013-04-01 15:15:12 +0200 |
commit | a9e15f1d415bd844f250ddae2e3278be21e6b83f (patch) | |
tree | 6952439e36e62277228762ccea51a372e3310536 /src | |
parent | 2cc8e7c3fe8f708e8ff7a645f7359c0b0ea33348 (diff) | |
download | gupnp-tools-a9e15f1d415bd844f250ddae2e3278be21e6b83f.tar.gz |
universal-cp: Preserve action argument order
Instead of GHashTable, which doesn't keep order of insertion use the
_begin_action_list variant when sending the action to preserve the argument
order as retrieved from introspection.
Fixes http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=519464
Diffstat (limited to 'src')
-rw-r--r-- | src/universal-cp/action-dialog.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/universal-cp/action-dialog.c b/src/universal-cp/action-dialog.c index fa3823e..8045da2 100644 --- a/src/universal-cp/action-dialog.c +++ b/src/universal-cp/action-dialog.c @@ -572,18 +572,14 @@ update_out_action_argument_widget (GtkWidget *arg_widget, } } -static GHashTable * +static void retrieve_in_action_arguments (GUPnPServiceIntrospection *introspection, - GUPnPServiceActionInfo *action_info) + GUPnPServiceActionInfo *action_info, + GList **in_names, + GList **in_values) { - GHashTable *in_args; GList *arg_node; - in_args = g_hash_table_new_full (g_str_hash, - g_direct_equal, - NULL, - g_value_free); - arg_node = gtk_container_get_children (GTK_CONTAINER (in_args_table)); for (; arg_node; arg_node = arg_node->next) { @@ -600,10 +596,9 @@ retrieve_in_action_arguments (GUPnPServiceIntrospection *introspection, if (name == NULL) continue; - g_hash_table_insert (in_args, name, value); + *in_names = g_list_append (*in_names, name); + *in_values = g_list_append (*in_values, value); } - - return in_args; } static GHashTable * @@ -735,22 +730,27 @@ on_action_invocation (GtkButton *button, GUPnPServiceProxy *proxy; GUPnPServiceIntrospection *introspection; GUPnPServiceActionInfo *action_info; - GHashTable *in_args; + GList *in_names = NULL, *in_values = NULL; action_info = get_selected_action (&proxy, &introspection); if (action_info == NULL) return; - in_args = retrieve_in_action_arguments (introspection, - action_info); + retrieve_in_action_arguments (introspection, + action_info, + &in_names, + &in_values); + + gupnp_service_proxy_begin_action_list (proxy, + action_info->name, + in_names, + in_values, + on_action_complete, + NULL); - gupnp_service_proxy_begin_action_hash (proxy, - action_info->name, - on_action_complete, - NULL, - in_args); + g_list_free (in_names); + g_list_free_full (in_values, g_value_free); - g_hash_table_destroy (in_args); g_object_unref (proxy); g_object_unref (introspection); } |