[gupnp/wip/phako/new-api] wip: Fix deprecation warnings



commit 7ed92de40160d9907216a5e2f1a9c5790152a858
Author: Jens Georg <mail jensge org>
Date:   Sun Jan 13 17:51:12 2019 +0100

    wip: Fix deprecation warnings

 tests/gtest/test-bugs.c |  2 ++
 tests/test-proxy.c      | 20 +++++++++++++++++---
 2 files changed, 19 insertions(+), 3 deletions(-)
---
diff --git a/tests/gtest/test-bugs.c b/tests/gtest/test-bugs.c
index 252109f..54343ef 100644
--- a/tests/gtest/test-bugs.c
+++ b/tests/gtest/test-bugs.c
@@ -243,6 +243,7 @@ test_bgo_696762 (void)
     test_run_loop (data.loop);
     g_assert (data.proxy != NULL);
 
+    G_GNUC_BEGIN_IGNORE_DEPRECATIONS
     gupnp_service_proxy_begin_action (data.proxy,
                                       "Browse",
                                       test_bgo_696762_on_browse,
@@ -254,6 +255,7 @@ test_bgo_696762 (void)
                                       "RequestedCount", G_TYPE_UINT, 0,
                                       "SortCriteria", G_TYPE_STRING, "",
                                       NULL);
+    G_GNUC_END_IGNORE_DEPRECATIONS
 
     test_run_loop (data.loop);
 
diff --git a/tests/test-proxy.c b/tests/test-proxy.c
index 6eeb1dc..77530e7 100644
--- a/tests/test-proxy.c
+++ b/tests/test-proxy.c
@@ -61,6 +61,7 @@ service_proxy_available_cb (G_GNUC_UNUSED GUPnPControlPoint *cp,
         char *result = NULL;
         guint count, total;
         GError *error = NULL;
+        GUPnPServiceProxyAction *action = NULL;
 
         location = gupnp_service_info_get_location (GUPNP_SERVICE_INFO (proxy));
 
@@ -84,9 +85,8 @@ service_proxy_available_cb (G_GNUC_UNUSED GUPnPControlPoint *cp,
         gupnp_service_proxy_set_subscribed (proxy, TRUE);
 
         /* And test action IO */
-        gupnp_service_proxy_send_action (proxy,
+        action = gupnp_service_proxy_action_new (
                                          "Browse",
-                                         &error,
                                          /* IN args */
                                          "ObjectID",
                                                 G_TYPE_STRING,
@@ -106,7 +106,19 @@ service_proxy_available_cb (G_GNUC_UNUSED GUPnPControlPoint *cp,
                                          "SortCriteria",
                                                 G_TYPE_STRING,
                                                 "",
-                                         NULL,
+                                         NULL);
+        gupnp_service_proxy_call_action (proxy, action, NULL, &error);
+
+        if (error) {
+                g_printerr ("Error: %s\n", error->message);
+                g_error_free (error);
+                gupnp_service_proxy_action_unref (action);
+
+                return;
+        }
+
+        gupnp_service_proxy_action_get_result (action,
+                                               &error,
                                          /* OUT args */
                                          "Result",
                                                 G_TYPE_STRING,
@@ -122,6 +134,7 @@ service_proxy_available_cb (G_GNUC_UNUSED GUPnPControlPoint *cp,
         if (error) {
                 g_printerr ("Error: %s\n", error->message);
                 g_error_free (error);
+                gupnp_service_proxy_action_unref (action);
 
                 return;
         }
@@ -131,6 +144,7 @@ service_proxy_available_cb (G_GNUC_UNUSED GUPnPControlPoint *cp,
         g_print ("\tNumberReturned: %u\n", count);
         g_print ("\tTotalMatches:   %u\n", total);
 
+        gupnp_service_proxy_action_unref (action);
         g_free (result);
 }
 


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