[gupnp] ServiceProxy: Remove deprecated API



commit 020e2dceaecdfdc665ea70d45ac954c989e317e9
Author: Jens Georg <mail jensge org>
Date:   Sun Jan 16 13:52:21 2022 +0100

    ServiceProxy: Remove deprecated API

 libgupnp/gupnp-service-proxy-action-private.h |   2 -
 libgupnp/gupnp-service-proxy.c                | 536 --------------------------
 libgupnp/gupnp-service-proxy.h                |  80 ----
 tests/test-bugs.c                             | 198 ++--------
 vala/GUPnP-1.6.metadata                       |   4 -
 vala/gupnp-custom.vala                        |   9 -
 6 files changed, 30 insertions(+), 799 deletions(-)
---
diff --git a/libgupnp/gupnp-service-proxy-action-private.h b/libgupnp/gupnp-service-proxy-action-private.h
index 8fc8981..27dc85e 100644
--- a/libgupnp/gupnp-service-proxy-action-private.h
+++ b/libgupnp/gupnp-service-proxy-action-private.h
@@ -143,8 +143,6 @@ struct _GUPnPServiceProxyAction {
         GCancellable *cancellable;
         gulong cancellable_connection_id;
 
-        // Support for legacy async calls
-        GUPnPServiceProxyActionCallback callback;
         gpointer user_data;
         GError *error; /* If non-NULL, description of error that
                           occurred when preparing message */
diff --git a/libgupnp/gupnp-service-proxy.c b/libgupnp/gupnp-service-proxy.c
index 7cf6c6d..310da07 100644
--- a/libgupnp/gupnp-service-proxy.c
+++ b/libgupnp/gupnp-service-proxy.c
@@ -364,245 +364,6 @@ gupnp_service_proxy_class_init (GUPnPServiceProxyClass *klass)
                               G_TYPE_POINTER);
 }
 
-/**
- * gupnp_service_proxy_send_action:
- * @proxy: A #GUPnPServiceProxy
- * @action: An action
- * @error: (inout)(optional)(nullable): The location where to store any error, or %NULL
- * @...: tuples of in parameter name, in parameter type, and in parameter
- * value, followed by %NULL, and then tuples of out parameter name,
- * out parameter type, and out parameter value location, terminated with %NULL
- *
- * Sends action @action with parameters @Varargs to the service exposed by
- * @proxy synchronously.
- *
- * If an error occurred, @error will be set. In case of
- * an UPnP error the error code will be the same in @error.
- *
- * Return value: %TRUE if sending the action was successful.
- *
- * Deprecated: 1.2.0: Use gupnp_service_proxy_action_new() and
- * gupnp_service_proxy_call_action()
- **/
-gboolean
-gupnp_service_proxy_send_action (GUPnPServiceProxy *proxy,
-                                 const char        *action,
-                                 GError           **error,
-                                 ...)
-{
-        va_list var_args;
-        gboolean ret;
-
-        va_start (var_args, error);
-        G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-        ret = gupnp_service_proxy_send_action_valist (proxy,
-                                                      action,
-                                                      error,
-                                                      var_args);
-        G_GNUC_END_IGNORE_DEPRECATIONS
-        va_end (var_args);
-
-        return ret;
-}
-
-/**
- * gupnp_service_proxy_send_action_valist:
- * @proxy: A #GUPnPServiceProxy
- * @action: An action
- * @error: (inout)(optional)(nullable): The location where to store any error, or %NULL
- * @var_args: va_list of tuples of in parameter name, in parameter type, and in
- * parameter value, followed by %NULL, and then tuples of out parameter name,
- * out parameter type, and out parameter value location
- *
- * See gupnp_service_proxy_send_action().
- *
- * Return value: %TRUE if sending the action was successful.
- *
- * Deprecated: 1.2.0
- **/
-gboolean
-gupnp_service_proxy_send_action_valist (GUPnPServiceProxy *proxy,
-                                        const char        *action_name,
-                                        GError           **error,
-                                        va_list            var_args)
-{
-        GList *in_names = NULL, *in_values = NULL;
-        GHashTable *out_hash = NULL;
-        va_list var_args_copy;
-        gboolean result;
-        GError *local_error;
-        GUPnPServiceProxyAction *handle;
-
-        g_return_val_if_fail (GUPNP_IS_SERVICE_PROXY (proxy), FALSE);
-        g_return_val_if_fail (action_name, FALSE);
-
-
-        VAR_ARGS_TO_IN_LIST (var_args, in_names, in_values);
-        G_VA_COPY (var_args_copy, var_args);
-        out_hash = g_hash_table_new_full (g_str_hash,
-                                          g_str_equal,
-                                          g_free,
-                                          gvalue_free);
-        VAR_ARGS_TO_OUT_HASH_TABLE (var_args, out_hash);
-
-        handle = gupnp_service_proxy_action_new_from_list (action_name, in_names, in_values);
-
-        if (gupnp_service_proxy_call_action (proxy, handle, NULL, error) == NULL) {
-                result = FALSE;
-                goto out;
-        }
-
-        result = gupnp_service_proxy_action_get_result_hash (handle,
-                                                             out_hash,
-                                                             &local_error);
-
-        if (local_error == NULL) {
-                OUT_HASH_TABLE_TO_VAR_ARGS (out_hash, var_args_copy);
-        } else {
-                g_propagate_error (error, local_error);
-        }
-out:
-        gupnp_service_proxy_action_unref (handle);
-        va_end (var_args_copy);
-        g_list_free_full (in_names, g_free);
-        g_list_free_full (in_values, gvalue_free);
-        g_hash_table_unref (out_hash);
-
-        return result;
-}
-
-/**
- * gupnp_service_proxy_send_action_list:
- * @proxy: (transfer none): A #GUPnPServiceProxy
- * @action: An action
- * @in_names: (element-type utf8) (transfer none): #GList of 'in' parameter
- * names (as strings)
- * @in_values: (element-type GValue) (transfer none): #GList of values (as
- * #GValue) that line up with @in_names
- * @out_names: (element-type utf8) (transfer none): #GList of 'out' parameter
- * names (as strings)
- * @out_types: (element-type GType) (transfer none): #GList of types (as #GType)
- * that line up with @out_names
- * @out_values: (element-type GValue) (transfer full) (out): #GList of values
- * (as #GValue) that line up with @out_names and @out_types.
- * @error: (inout)(optional)(nullable): The location where to store any error, or %NULL
- *
- * The synchronous variant of [class@GUPnP.ServiceProxy.begin_action_list] and
- * [class@GUPnP.ServiceProxy.end_action_list].
- *
- * Return value: %TRUE if sending the action was successful.
- *
- * Deprecated: 1.2.0: Use gupnp_service_proxy_action_new_from_list() and gupnp_service_proxy_call_action()
- *
- **/
-gboolean
-gupnp_service_proxy_send_action_list (GUPnPServiceProxy *proxy,
-                                      const char        *action,
-                                      GList             *in_names,
-                                      GList             *in_values,
-                                      GList             *out_names,
-                                      GList             *out_types,
-                                      GList            **out_values,
-                                      GError           **error)
-{
-        GUPnPServiceProxyAction *handle;
-        gboolean result = FALSE;
-
-        g_return_val_if_fail (GUPNP_IS_SERVICE_PROXY (proxy), FALSE);
-        g_return_val_if_fail (action, FALSE);
-
-        handle = gupnp_service_proxy_action_new_from_list (action, in_names, in_values);
-
-        if (gupnp_service_proxy_call_action (proxy, handle, NULL, error) == NULL) {
-                result = FALSE;
-
-                goto out;
-        }
-
-        result = gupnp_service_proxy_action_get_result_list (handle,
-                                                             out_names,
-                                                             out_types,
-                                                             out_values,
-                                                             error);
-out:
-        gupnp_service_proxy_action_unref (handle);
-
-        return result;
-}
-
-static void
-on_legacy_async_callback (GObject *source, GAsyncResult *res, gpointer user_data)
-{
-        GError *error = NULL;
-        GUPnPServiceProxyAction *action;
-
-        gupnp_service_proxy_call_action_finish (GUPNP_SERVICE_PROXY (source), res, &error);
-        action = (GUPnPServiceProxyAction *) user_data;
-
-        /* Do not perform legacy call-back if action is cancelled, to comply with the old implementation */
-        if (action->callback != NULL &&
-            !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
-                if (error != NULL)
-                        g_propagate_error (&action->error, error);
-                action->callback (action->proxy, action, action->user_data);
-        }
-
-        g_clear_error (&error);
-}
-
-/**
- * gupnp_service_proxy_begin_action:
- * @proxy: A #GUPnPServiceProxy
- * @action: An action
- * @callback: (scope async): The callback to call when sending the action has succeeded
- * or failed
- * @user_data: User data for @callback
- * @...: tuples of in parameter name, in parameter type, and in parameter
- * value, terminated with %NULL
- *
- * Sends action @action with parameters @Varargs to the service exposed by
- * @proxy asynchronously, calling @callback on completion. From @callback, call
- * gupnp_service_proxy_end_action() to check for errors, to retrieve return
- * values, and to free the #GUPnPServiceProxyAction.
- *
- * Returns: (transfer none): A #GUPnPServiceProxyAction handle. This will be freed when
- * gupnp_service_proxy_cancel_action() or
- * gupnp_service_proxy_end_action_valist().
- *
- * Deprecated: 1.2.0: Use gupnp_service_proxy_action_new() and
- * gupnp_service_proxy_call_action_async()
- **/
-GUPnPServiceProxyAction *
-gupnp_service_proxy_begin_action (GUPnPServiceProxy              *proxy,
-                                  const char                     *action,
-                                  GUPnPServiceProxyActionCallback callback,
-                                  gpointer                        user_data,
-                                  ...)
-{
-        GUPnPServiceProxyAction *ret;
-        GList *in_names = NULL;
-        GList *in_values = NULL;
-        va_list var_args;
-
-        va_start (var_args, user_data);
-        VAR_ARGS_TO_IN_LIST (var_args, in_names, in_values);
-        va_end (var_args);
-
-        ret = gupnp_service_proxy_action_new_from_list (action, in_names, in_values);
-        g_list_free_full (in_names, g_free);
-        g_list_free_full (in_values, gvalue_free);
-
-        ret->callback = callback;
-        ret->user_data = user_data;
-
-        gupnp_service_proxy_call_action_async (proxy,
-                                               ret,
-                                               NULL,
-                                               on_legacy_async_callback,
-                                               ret);
-
-        return ret;
-}
 
 static void
 on_action_cancelled (GCancellable *cancellable, gpointer user_data)
@@ -828,303 +589,6 @@ gupnp_service_proxy_action_queue_task (GTask *task)
         action->pending = TRUE;
 }
 
-/**
- * gupnp_service_proxy_begin_action_valist:
- * @proxy: A #GUPnPServiceProxy
- * @action: An action
- * @callback: (scope async) : The callback to call when sending the action has succeeded
- * or failed
- * @user_data: User data for @callback
- * @var_args: A va_list of tuples of in parameter name, in parameter type, and
- * in parameter value
- *
- * See gupnp_service_proxy_begin_action().
- *
- * Returns: (transfer none): A #GUPnPServiceProxyAction handle. This will
- * be freed when calling gupnp_service_proxy_cancel_action() or
- * gupnp_service_proxy_end_action_valist().
- *
- * Deprecated: 1.2.0
- **/
-GUPnPServiceProxyAction *
-gupnp_service_proxy_begin_action_valist
-                                   (GUPnPServiceProxy              *proxy,
-                                    const char                     *action,
-                                    GUPnPServiceProxyActionCallback callback,
-                                    gpointer                        user_data,
-                                    va_list                         var_args)
-{
-        GUPnPServiceProxyAction *ret;
-        GList *in_names = NULL;
-        GList *in_values = NULL;
-
-        VAR_ARGS_TO_IN_LIST (var_args, in_names, in_values);
-
-        ret = gupnp_service_proxy_action_new_from_list (action, in_names, in_values);
-        g_list_free_full (in_names, g_free);
-        g_list_free_full (in_values, gvalue_free);
-
-        ret->callback = callback;
-        ret->user_data = user_data;
-
-        gupnp_service_proxy_call_action_async (proxy,
-                                               ret,
-                                               NULL,
-                                               on_legacy_async_callback,
-                                               ret);
-
-        return ret;
-
-}
-
-/**
- * gupnp_service_proxy_begin_action_list:
- * @proxy: (transfer none): A #GUPnPServiceProxy
- * @action: An action
- * @in_names: (element-type utf8) (transfer none): #GList of 'in' parameter
- * names (as strings)
- * @in_values: (element-type GValue) (transfer none): #GList of values (as
- * #GValue) that line up with @in_names
- * @callback: (scope async) : The callback to call when sending the action has succeeded or
- * failed
- * @user_data: User data for @callback
- *
- * A variant of #gupnp_service_proxy_begin_action that takes lists of
- * in-parameter names, types and values.
- *
- * Return value: (transfer none): A #GUPnPServiceProxyAction handle. This will
- * be freed when calling gupnp_service_proxy_cancel_action() or
- * gupnp_service_proxy_end_action_list().
- *
- * Since: 0.14.0
- **/
-GUPnPServiceProxyAction *
-gupnp_service_proxy_begin_action_list
-                                   (GUPnPServiceProxy               *proxy,
-                                    const char                      *action,
-                                    GList                           *in_names,
-                                    GList                           *in_values,
-                                    GUPnPServiceProxyActionCallback  callback,
-                                    gpointer                         user_data)
-{
-        GUPnPServiceProxyAction *ret;
-
-        ret = gupnp_service_proxy_action_new_from_list (action, in_names, in_values);
-
-        ret->callback = callback;
-        ret->user_data = user_data;
-
-        gupnp_service_proxy_call_action_async (proxy,
-                                               ret,
-                                               NULL,
-                                               on_legacy_async_callback,
-                                               ret);
-
-        return ret;
-}
-
-/**
- * gupnp_service_proxy_end_action:
- * @proxy: A #GUPnPServiceProxy
- * @action: A #GUPnPServiceProxyAction handle
- * @error: (inout)(optional)(nullable): The location where to store any error, or %NULL
- * @...: tuples of out parameter name, out parameter type, and out parameter
- * value location, terminated with %NULL. The out parameter values should be
- * freed after use
- *
- * Retrieves the result of @action. The out parameters in @Varargs will be
- * filled in, and if an error occurred, @error will be set. In case of
- * an UPnP error the error code will be the same in @error.
- *
- * Return value: %TRUE on success.
- **/
-gboolean
-gupnp_service_proxy_end_action (GUPnPServiceProxy       *proxy,
-                                GUPnPServiceProxyAction *action,
-                                GError                 **error,
-                                ...)
-{
-        va_list var_args;
-        gboolean ret;
-
-        g_return_val_if_fail (GUPNP_IS_SERVICE_PROXY (proxy), FALSE);
-        g_return_val_if_fail (action, FALSE);
-
-        if (action->error) {
-                g_propagate_error (error, action->error);
-                gupnp_service_proxy_action_unref (action);
-
-                return FALSE;
-        }
-
-
-        va_start (var_args, error);
-        ret = gupnp_service_proxy_action_get_result_valist (action, error, var_args);
-        va_end (var_args);
-
-        gupnp_service_proxy_action_unref (action);
-
-        return ret;
-}
-
-/**
- * gupnp_service_proxy_end_action_valist:
- * @proxy: A #GUPnPServiceProxy
- * @action: A #GUPnPServiceProxyAction handle
- * @error: (inout)(optional)(nullable): The location where to store any error, or %NULL
- * @var_args: A va_list of tuples of out parameter name, out parameter type,
- * and out parameter value location. The out parameter values should be
- * freed after use
- *
- * See gupnp_service_proxy_end_action().
- *
- * Return value: %TRUE on success.
- **/
-gboolean
-gupnp_service_proxy_end_action_valist (GUPnPServiceProxy       *proxy,
-                                       GUPnPServiceProxyAction *action,
-                                       GError                 **error,
-                                       va_list                  var_args)
-{
-        gboolean result;
-
-        g_return_val_if_fail (GUPNP_IS_SERVICE_PROXY (proxy), FALSE);
-        g_return_val_if_fail (action, FALSE);
-
-        if (action->error) {
-                g_propagate_error (error, action->error);
-                gupnp_service_proxy_action_unref (action);
-
-                return FALSE;
-        }
-
-        result = gupnp_service_proxy_action_get_result_valist (action,
-                                                               error,
-                                                               var_args);
-        gupnp_service_proxy_action_unref (action);
-
-        return result;
-}
-
-/**
- * gupnp_service_proxy_end_action_list:
- * @proxy: A #GUPnPServiceProxy
- * @action: A #GUPnPServiceProxyAction handle
- * @error:(inout)(optional)(nullable): The location where to store any error, or %NULL
- * @out_names: (element-type utf8) (transfer none): #GList of 'out' parameter
- * names (as strings)
- * @out_types: (element-type GType) (transfer none): #GList of types (as #GType)
- * that line up with @out_names
- * @out_values: (element-type GValue) (transfer full) (out): #GList of values
- * (as #GValue) that line up with @out_names and @out_types.
- *
- * A variant of #gupnp_service_proxy_end_action that takes lists of
- * out-parameter names, types and place-holders for values.
- *
- * The returned list
- * in @out_values must be freed using #g_list_free and each element in it using
- * #g_value_unset and #g_slice_free.
- *
- * Return value : %TRUE on success.
- *
- **/
-gboolean
-gupnp_service_proxy_end_action_list (GUPnPServiceProxy       *proxy,
-                                     GUPnPServiceProxyAction *action,
-                                     GList                   *out_names,
-                                     GList                   *out_types,
-                                     GList                  **out_values,
-                                     GError                 **error)
-{
-        gboolean result;
-
-        g_return_val_if_fail (GUPNP_IS_SERVICE_PROXY (proxy), FALSE);
-        g_return_val_if_fail (action, FALSE);
-
-        /* Check for saved error from begin_action() */
-        if (action->error) {
-                g_propagate_error (error, action->error);
-                gupnp_service_proxy_action_unref (action);
-
-                return FALSE;
-        }
-
-        result = gupnp_service_proxy_action_get_result_list (action,
-                                                             out_names,
-                                                             out_types,
-                                                             out_values,
-                                                             error);
-        gupnp_service_proxy_action_unref (action);
-
-        return result;
-}
-
-/**
- * gupnp_service_proxy_end_action_hash:
- * @proxy: A #GUPnPServiceProxy
- * @action: A #GUPnPServiceProxyAction handle
- * @error:(inout)(optional)(nullable): The location where to store any error, or %NULL
- * @hash: (element-type utf8 GValue) (inout) (transfer none): A #GHashTable of
- * out parameter name and initialised #GValue pairs
- *
- * See gupnp_service_proxy_end_action(); this version takes a #GHashTable for
- * runtime generated parameter lists.
- *
- * Return value: %TRUE on success.
- *
- **/
-gboolean
-gupnp_service_proxy_end_action_hash
-                                   (GUPnPServiceProxy              *proxy,
-                                    GUPnPServiceProxyAction        *action,
-                                    GHashTable                     *hash,
-                                    GError                        **error)
-{
-        gboolean result;
-
-        g_return_val_if_fail (GUPNP_IS_SERVICE_PROXY (proxy), FALSE);
-        g_return_val_if_fail (action, FALSE);
-
-        /* Check for saved error from begin_action() */
-        if (action->error) {
-                g_propagate_error (error, action->error);
-                gupnp_service_proxy_action_unref (action);
-
-                return FALSE;
-        }
-
-
-        result = gupnp_service_proxy_action_get_result_hash (action,
-                                                             hash,
-                                                             error);
-        gupnp_service_proxy_action_unref (action);
-
-        return result;
-}
-
-/**
- * gupnp_service_proxy_cancel_action:
- * @proxy: A #GUPnPServiceProxy
- * @action: A #GUPnPServiceProxyAction handle
- *
- * Cancels @action, freeing the @action handle.
- *
- * Deprecated: 1.2.0: Use the #GCancellable passed to
- * gupnp_service_proxy_call_action_async() or gupnp_service_proxy_call_action()
- **/
-void
-gupnp_service_proxy_cancel_action (GUPnPServiceProxy       *proxy,
-                                   GUPnPServiceProxyAction *action)
-{
-        g_return_if_fail (GUPNP_IS_SERVICE_PROXY (proxy));
-        g_return_if_fail (action);
-
-        if (action->cancellable != NULL) {
-                g_cancellable_cancel (action->cancellable);
-        }
-
-        gupnp_service_proxy_action_unref (action);
-}
 
 /**
  * gupnp_service_proxy_add_notify: (skip)
diff --git a/libgupnp/gupnp-service-proxy.h b/libgupnp/gupnp-service-proxy.h
index 7c4b8e9..c3ffdc6 100644
--- a/libgupnp/gupnp-service-proxy.h
+++ b/libgupnp/gupnp-service-proxy.h
@@ -84,86 +84,6 @@ typedef void (* GUPnPServiceProxyNotifyCallback) (GUPnPServiceProxy *proxy,
                                                   GValue            *value,
                                                   gpointer           user_data);
 
-G_DEPRECATED gboolean
-gupnp_service_proxy_send_action    (GUPnPServiceProxy              *proxy,
-                                    const char                     *action,
-                                    GError                        **error,
-                                    ...) G_GNUC_NULL_TERMINATED;
-
-G_DEPRECATED gboolean
-gupnp_service_proxy_send_action_valist
-                                   (GUPnPServiceProxy              *proxy,
-                                    const char                     *action,
-                                    GError                        **error,
-                                    va_list                         var_args);
-
-G_DEPRECATED gboolean
-gupnp_service_proxy_send_action_list (GUPnPServiceProxy *proxy,
-                                      const char        *action,
-                                      GList             *in_names,
-                                      GList             *in_values,
-                                      GList             *out_names,
-                                      GList             *out_types,
-                                      GList            **out_values,
-                                      GError           **error);
-
-G_DEPRECATED GUPnPServiceProxyAction *
-gupnp_service_proxy_begin_action   (GUPnPServiceProxy              *proxy,
-                                    const char                     *action,
-                                    GUPnPServiceProxyActionCallback callback,
-                                    gpointer                        user_data,
-                                    ...) G_GNUC_NULL_TERMINATED;
-
-G_DEPRECATED GUPnPServiceProxyAction *
-gupnp_service_proxy_begin_action_valist
-                                   (GUPnPServiceProxy              *proxy,
-                                    const char                     *action,
-                                    GUPnPServiceProxyActionCallback callback,
-                                    gpointer                        user_data,
-                                    va_list                         var_args);
-
-G_DEPRECATED GUPnPServiceProxyAction *
-gupnp_service_proxy_begin_action_list
-                                   (GUPnPServiceProxy              *proxy,
-                                    const char                     *action,
-                                    GList                          *in_names,
-                                    GList                          *in_values,
-                                    GUPnPServiceProxyActionCallback callback,
-                                    gpointer                        user_data);
-
-G_DEPRECATED gboolean
-gupnp_service_proxy_end_action     (GUPnPServiceProxy              *proxy,
-                                    GUPnPServiceProxyAction        *action,
-                                    GError                        **error,
-                                    ...) G_GNUC_NULL_TERMINATED;
-
-G_DEPRECATED gboolean
-gupnp_service_proxy_end_action_valist
-                                   (GUPnPServiceProxy              *proxy,
-                                    GUPnPServiceProxyAction        *action,
-                                    GError                        **error,
-                                    va_list                         var_args);
-
-G_DEPRECATED gboolean
-gupnp_service_proxy_end_action_list
-                                  (GUPnPServiceProxy       *proxy,
-                                   GUPnPServiceProxyAction *action,
-                                   GList                   *out_names,
-                                   GList                   *out_types,
-                                   GList                  **out_values,
-                                   GError                  **error);
-
-G_DEPRECATED gboolean
-gupnp_service_proxy_end_action_hash
-                                   (GUPnPServiceProxy              *proxy,
-                                    GUPnPServiceProxyAction        *action,
-                                    GHashTable                     *hash,
-                                    GError                        **error);
-
-G_DEPRECATED void
-gupnp_service_proxy_cancel_action  (GUPnPServiceProxy              *proxy,
-                                    GUPnPServiceProxyAction        *action);
-
 gboolean
 gupnp_service_proxy_add_notify     (GUPnPServiceProxy              *proxy,
                                     const char                     *variable,
diff --git a/tests/test-bugs.c b/tests/test-bugs.c
index 40aa782..f2ab235 100644
--- a/tests/test-bugs.c
+++ b/tests/test-bugs.c
@@ -94,8 +94,8 @@ test_bgo_696762_on_browse_call (G_GNUC_UNUSED GUPnPService *service,
 }
 
 static void
-test_bgo_696762_on_browse (G_GNUC_UNUSED GUPnPServiceProxy       *proxy,
-                           G_GNUC_UNUSED GUPnPServiceProxyAction *action,
+test_bgo_696762_on_browse (G_GNUC_UNUSED GObject       *source,
+                           G_GNUC_UNUSED GAsyncResult *res,
                            gpointer                               user_data)
 {
     TestServiceProxyData *data = (TestServiceProxyData *) user_data;
@@ -244,31 +244,35 @@ test_bgo_696762 (void)
     g_assert (data.proxy != NULL);
 
     G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
     GUPnPServiceProxyAction *a =
-            gupnp_service_proxy_begin_action (data.proxy,
-                                              "Browse",
-                                              test_bgo_696762_on_browse,
-                                              &data,
-                                              "ObjectID",
-                                              G_TYPE_STRING,
-                                              "0",
-                                              "BrowseFlag",
-                                              G_TYPE_STRING,
-                                              "BrowseDirectChildren",
-                                              "Filter",
-                                              G_TYPE_STRING,
-                                              "res,dc:date,res@size",
-                                              "StartingIndex",
-                                              G_TYPE_UINT,
-                                              0,
-                                              "RequestedCount",
-                                              G_TYPE_UINT,
-                                              0,
-                                              "SortCriteria",
-                                              G_TYPE_STRING,
-                                              "",
-                                              NULL);
-    G_GNUC_END_IGNORE_DEPRECATIONS
+            gupnp_service_proxy_action_new ("Browse",
+                                            "ObjectID",
+                                            G_TYPE_STRING,
+                                            "0",
+                                            "BrowseFlag",
+                                            G_TYPE_STRING,
+                                            "BrowseDirectChildren",
+                                            "Filter",
+                                            G_TYPE_STRING,
+                                            "res,dc:date,res@size",
+                                            "StartingIndex",
+                                            G_TYPE_UINT,
+                                            0,
+                                            "RequestedCount",
+                                            G_TYPE_UINT,
+                                            0,
+                                            "SortCriteria",
+                                            G_TYPE_STRING,
+                                            "",
+                                            NULL);
+
+    gupnp_service_proxy_call_action_async (data.proxy,
+                                           a,
+                                           NULL,
+                                           test_bgo_696762_on_browse,
+                                           &data);
+
 
     test_run_loop (data.loop, g_test_get_path ());
 
@@ -582,147 +586,6 @@ test_ggo_24 (void)
                 validate_host_header ("[fe80::01%eth0]", "fe80::acab", 4711));
 }
 
-/*
- * Test that the legacy async _end_action calls still work
- *
- * https://gitlab.gnome.org/GNOME/gupnp/-/issues/58
- */
-
-static void
-test_ggo_58_on_ping (GUPnPServiceProxy *proxy,
-                     GUPnPServiceProxyAction *action,
-                     gpointer user_data)
-{
-        TestServiceProxyData *data = (TestServiceProxyData *) user_data;
-
-        g_main_loop_quit (data->loop);
-}
-
-static void
-test_ggo_58_on_ping_call (GUPnPService *service,
-                          GUPnPServiceAction *action,
-                          gpointer user_data)
-{
-        gupnp_service_action_return_success (action);
-}
-
-static void
-test_ggo_58 ()
-{
-        GUPnPContext *context = NULL;
-        GError *error = NULL;
-        GUPnPControlPoint *cp = NULL;
-        GUPnPRootDevice *rd;
-        TestServiceProxyData data = { NULL, NULL };
-        GUPnPServiceInfo *info = NULL;
-
-        data.loop = g_main_loop_new (NULL, FALSE);
-
-        context = create_context (0, &error);
-        g_assert_no_error (error);
-        g_assert (context != NULL);
-
-        cp = gupnp_control_point_new (
-                context,
-                "urn:test-gupnp-org:service:TestService:1");
-
-        gssdp_resource_browser_set_active (GSSDP_RESOURCE_BROWSER (cp), TRUE);
-
-        g_signal_connect (G_OBJECT (cp),
-                          "service-proxy-available",
-                          G_CALLBACK (test_on_sp_available),
-                          &data);
-
-
-        rd = gupnp_root_device_new (context,
-                                    "TestDevice.xml",
-                                    DATA_PATH,
-                                    &error);
-        g_assert_no_error (error);
-        g_assert (rd != NULL);
-        gupnp_root_device_set_available (rd, TRUE);
-        info = gupnp_device_info_get_service (
-                GUPNP_DEVICE_INFO (rd),
-                "urn:test-gupnp-org:service:TestService:1");
-        g_signal_connect (G_OBJECT (info),
-                          "action-invoked::Ping",
-                          G_CALLBACK (test_ggo_58_on_ping_call),
-                          &data);
-
-        test_run_loop (data.loop, g_test_get_path());
-        g_assert (data.proxy != NULL);
-
-        G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-        GUPnPServiceProxyAction *action =
-                gupnp_service_proxy_begin_action (data.proxy,
-                                                  "Ping",
-                                                  test_ggo_58_on_ping,
-                                                  &data,
-                                                  NULL);
-
-        test_run_loop (data.loop, g_test_get_path());
-
-        gboolean success = gupnp_service_proxy_end_action (data.proxy,
-                                                           action,
-                                                           &error,
-                                                           NULL);
-
-        g_assert (success);
-        g_assert_no_error (error);
-
-        action = gupnp_service_proxy_begin_action (data.proxy,
-                                                   "Ping",
-                                                   test_ggo_58_on_ping,
-                                                   &data,
-                                                   NULL);
-
-        test_run_loop (data.loop, g_test_get_path());
-
-        GHashTable *result_hash = g_hash_table_new (g_str_hash, g_str_equal);
-
-        success = gupnp_service_proxy_end_action_hash (data.proxy,
-                                                       action,
-                                                       result_hash,
-                                                       &error);
-        g_hash_table_destroy (result_hash);
-
-        g_assert (success);
-        g_assert_no_error (error);
-
-        action = gupnp_service_proxy_begin_action (data.proxy,
-                                                   "Ping",
-                                                   test_ggo_58_on_ping,
-                                                   &data,
-                                                   NULL);
-
-        test_run_loop (data.loop, g_test_get_path());
-
-        GList *result_list = NULL;
-        success = gupnp_service_proxy_end_action_list (data.proxy,
-                                                       action,
-                                                       NULL,
-                                                       NULL,
-                                                       &result_list,
-                                                       &error);
-
-        g_assert (success);
-        g_assert_no_error (error);
-
-        G_GNUC_END_IGNORE_DEPRECATIONS
-
-        g_object_unref (info);
-        g_object_unref (data.proxy);
-        g_object_unref (cp);
-        g_object_unref (rd);
-        g_object_unref (context);
-
-        // Make sure the source teardown handlers get run so we don't confuse valgrind
-        g_timeout_add (500, (GSourceFunc) delayed_loop_quitter, data.loop);
-        g_main_loop_run (data.loop);
-
-        g_main_loop_unref (data.loop);
-}
-
 void
 test_ggo_42 ()
 {
@@ -1003,7 +866,6 @@ main (int argc, char *argv[]) {
     g_test_add_func ("/bugs/bgo/722696", test_bgo_722696);
     g_test_add_func ("/bugs/bgo/743233", test_bgo_743233);
     g_test_add_func ("/bugs/ggo/24", test_ggo_24);
-    g_test_add_func ("/bugs/ggo/58", test_ggo_58);
     g_test_add_func ("/bugs/ggo/42", test_ggo_42);
     g_test_add_func ("/bugs/ggo/63", test_ggo_63);
     g_test_add_func ("/bugs/ggo/60", test_ggo_60_no_crash);
diff --git a/vala/GUPnP-1.6.metadata b/vala/GUPnP-1.6.metadata
index be67723..0e6a6ea 100644
--- a/vala/GUPnP-1.6.metadata
+++ b/vala/GUPnP-1.6.metadata
@@ -19,9 +19,5 @@ ServiceIntrospection
     .scpd skip
 ServiceProxy
     .add_notify skip=false
-    .begin_action skip=false
-    .end_action_hash skip
-    .end_action_list skip
-    .send_action_list skip
 XMLDoc
     .new skip
diff --git a/vala/gupnp-custom.vala b/vala/gupnp-custom.vala
index 3ad9fd0..f412e99 100644
--- a/vala/gupnp-custom.vala
+++ b/vala/gupnp-custom.vala
@@ -8,15 +8,6 @@
  * SPDX-License-Identifier: LGPL-2.1-or-later
  */
 
-public class GUPnP.ServiceProxy : GUPnP.ServiceInfo {
-    public bool send_action (string action, ...) throws GLib.Error;
-    public bool end_action (GUPnP.ServiceProxyAction action, ...) throws GLib.Error;
-    public bool end_action_hash (GUPnP.ServiceProxyAction action, GLib.HashTable<string, weak GLib.Value*> 
hash) throws GLib.Error;
-    public bool end_action_list (GUPnP.ServiceProxyAction action, GLib.List<string> out_names, 
GLib.List<GLib.Type?> out_types, out GLib.List<weak GLib.Value*> out_values) throws GLib.Error;
-
-    public bool send_action_list (string action, GLib.List<string> in_names, GLib.List<weak GLib.Value?> 
in_values, GLib.List<string> out_names, GLib.List<GLib.Type?> out_types, out GLib.List<weak GLib.Value*> 
out_values) throws GLib.Error;
-}
-
 [Compact]
 public class GUPnP.ServiceProxyAction {
     [CCode (has_construct_function = false)]


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]