From bccb160bc206cc2010401b76e29ecf7b6ad94946 Mon Sep 17 00:00:00 2001
From: George Kiagiadakis <george.kiagiadakis@collabora.com>
Date: Sun, 3 May 2020 19:49:21 +0300
Subject: [PATCH] port some more deprecated object-manager calls

---
 lib/wp/policy.c                              | 10 ++++++----
 modules/module-client-permissions.c          |  3 ++-
 modules/module-config-endpoint/context.c     |  3 ++-
 modules/module-config-static-nodes/context.c |  5 +++--
 tests/wp/endpoint.c                          | 10 +++++-----
 tests/wp/proxy.c                             |  7 ++++---
 tests/wp/session.c                           | 13 +++++++------
 7 files changed, 29 insertions(+), 22 deletions(-)

diff --git a/lib/wp/policy.c b/lib/wp/policy.c
index 7149c1a7..f44b4437 100644
--- a/lib/wp/policy.c
+++ b/lib/wp/policy.c
@@ -120,8 +120,8 @@ wp_policy_manager_get_instance (WpCore *core)
     mgr = g_object_new (WP_TYPE_POLICY_MANAGER, NULL);
 
     /* install the object manager to listen to added/removed endpoints */
-    wp_object_manager_add_interest (mgr->endpoints_om,
-        WP_TYPE_BASE_ENDPOINT, NULL, 0);
+    wp_object_manager_add_interest_1 (mgr->endpoints_om,
+        WP_TYPE_BASE_ENDPOINT, NULL);
     g_signal_connect_object (mgr->endpoints_om, "object-added",
         (GCallback) policy_mgr_endpoint_added, mgr, 0);
     g_signal_connect_object (mgr->endpoints_om, "object-removed",
@@ -129,8 +129,10 @@ wp_policy_manager_get_instance (WpCore *core)
     wp_core_install_object_manager (core, mgr->endpoints_om);
 
     /* install the object manager to listen to changed sessions */
-    wp_object_manager_add_interest (mgr->sessions_om,
-        WP_TYPE_IMPL_SESSION, NULL,
+    wp_object_manager_add_interest_1 (mgr->sessions_om,
+        WP_TYPE_IMPL_SESSION, NULL);
+    wp_object_manager_request_proxy_features (mgr->sessions_om,
+        WP_TYPE_IMPL_SESSION,
         WP_PROXY_FEATURES_STANDARD | WP_PROXY_FEATURE_CONTROLS);
     wp_core_install_object_manager (core, mgr->sessions_om);
 
diff --git a/modules/module-client-permissions.c b/modules/module-client-permissions.c
index 745b3114..f83510ab 100644
--- a/modules/module-client-permissions.c
+++ b/modules/module-client-permissions.c
@@ -33,7 +33,8 @@ wireplumber__module_init (WpModule * module, WpCore * core, GVariant * args)
   WpObjectManager *om;
 
   om = wp_object_manager_new ();
-  wp_object_manager_add_interest (om, WP_TYPE_CLIENT, NULL,
+  wp_object_manager_add_interest_1 (om, WP_TYPE_CLIENT, NULL);
+  wp_object_manager_request_proxy_features (om, WP_TYPE_CLIENT,
       WP_PROXY_FEATURES_STANDARD);
 
   g_signal_connect (om, "object-added", (GCallback) client_added, NULL);
diff --git a/modules/module-config-endpoint/context.c b/modules/module-config-endpoint/context.c
index 57d67115..d11e8212 100644
--- a/modules/module-config-endpoint/context.c
+++ b/modules/module-config-endpoint/context.c
@@ -260,7 +260,8 @@ wp_config_endpoint_context_init (WpConfigEndpointContext *self)
       g_direct_equal, NULL, (GDestroyNotify) g_object_unref);
 
   /* Only handle augmented nodes with info set */
-  wp_object_manager_add_interest (self->om, WP_TYPE_NODE, NULL,
+  wp_object_manager_add_interest_1 (self->om, WP_TYPE_NODE, NULL);
+  wp_object_manager_request_proxy_features (self->om, WP_TYPE_NODE,
       WP_PROXY_FEATURES_STANDARD);
 
   /* Register the global added/removed callbacks */
diff --git a/modules/module-config-static-nodes/context.c b/modules/module-config-static-nodes/context.c
index b4c82c77..6a7ce47b 100644
--- a/modules/module-config-static-nodes/context.c
+++ b/modules/module-config-static-nodes/context.c
@@ -213,8 +213,9 @@ wp_config_static_nodes_context_init (WpConfigStaticNodesContext *self)
   self->devices_om = wp_object_manager_new ();
 
   /* Only handle devices */
-  wp_object_manager_add_interest (self->devices_om,
-      WP_TYPE_DEVICE, NULL, WP_PROXY_FEATURE_INFO);
+  wp_object_manager_add_interest_1 (self->devices_om, WP_TYPE_DEVICE, NULL);
+  wp_object_manager_request_proxy_features (self->devices_om, WP_TYPE_DEVICE,
+      WP_PROXY_FEATURE_INFO);
   g_signal_connect (self->devices_om, "object-added",
       (GCallback) on_device_added, self);
 }
diff --git a/tests/wp/endpoint.c b/tests/wp/endpoint.c
index 7429591f..056a572c 100644
--- a/tests/wp/endpoint.c
+++ b/tests/wp/endpoint.c
@@ -287,9 +287,9 @@ test_endpoint_basic (TestEndpointFixture *fixture, gconstpointer data)
       (GCallback) test_endpoint_basic_impl_object_added, fixture);
   g_signal_connect (fixture->export_om, "object-removed",
       (GCallback) test_endpoint_basic_impl_object_removed, fixture);
-  wp_object_manager_add_interest (fixture->export_om,
-      WP_TYPE_ENDPOINT, NULL,
-      WP_PROXY_FEATURES_STANDARD | WP_PROXY_FEATURE_CONTROLS);
+  wp_object_manager_add_interest_1 (fixture->export_om, WP_TYPE_ENDPOINT, NULL);
+  wp_object_manager_request_proxy_features (fixture->export_om,
+      WP_TYPE_ENDPOINT, WP_PROXY_FEATURES_STANDARD | WP_PROXY_FEATURE_CONTROLS);
   wp_core_install_object_manager (fixture->base.core, fixture->export_om);
 
   /* set up the proxy side */
@@ -297,8 +297,8 @@ test_endpoint_basic (TestEndpointFixture *fixture, gconstpointer data)
       (GCallback) test_endpoint_basic_proxy_object_added, fixture);
   g_signal_connect (fixture->proxy_om, "object-removed",
       (GCallback) test_endpoint_basic_proxy_object_removed, fixture);
-  wp_object_manager_add_interest (fixture->proxy_om,
-      WP_TYPE_ENDPOINT, NULL,
+  wp_object_manager_add_interest_1 (fixture->proxy_om, WP_TYPE_ENDPOINT, NULL);
+  wp_object_manager_request_proxy_features (fixture->proxy_om, WP_TYPE_ENDPOINT,
       WP_PROXY_FEATURES_STANDARD | WP_PROXY_FEATURE_CONTROLS);
   wp_core_install_object_manager (fixture->base.client_core, fixture->proxy_om);
 
diff --git a/tests/wp/proxy.c b/tests/wp/proxy.c
index d10fad5b..3e816a76 100644
--- a/tests/wp/proxy.c
+++ b/tests/wp/proxy.c
@@ -83,7 +83,7 @@ test_proxy_basic (TestProxyFixture *fixture, gconstpointer data)
   g_signal_connect (fixture->om, "object-added",
       (GCallback) test_proxy_basic_object_added, fixture);
 
-  wp_object_manager_add_interest (fixture->om, WP_TYPE_CLIENT, NULL, 0);
+  wp_object_manager_add_interest_1 (fixture->om, WP_TYPE_CLIENT, NULL);
   wp_core_install_object_manager (fixture->base.core, fixture->om);
 
   g_main_loop_run (fixture->base.loop);
@@ -184,8 +184,9 @@ test_node (TestProxyFixture *fixture, gconstpointer data)
 
   /* declare interest and set default features to be ready
      when the signal is fired */
-  wp_object_manager_add_interest (fixture->om,
-      WP_TYPE_NODE, NULL, WP_PROXY_FEATURES_STANDARD);
+  wp_object_manager_add_interest_1 (fixture->om, WP_TYPE_NODE, NULL);
+  wp_object_manager_request_proxy_features (fixture->om, WP_TYPE_NODE,
+      WP_PROXY_FEATURES_STANDARD);
   wp_core_install_object_manager (fixture->base.core, fixture->om);
 
   g_main_loop_run (fixture->base.loop);
diff --git a/tests/wp/session.c b/tests/wp/session.c
index e07834ec..75b0f393 100644
--- a/tests/wp/session.c
+++ b/tests/wp/session.c
@@ -150,9 +150,10 @@ test_session_basic (TestSessionFixture *fixture, gconstpointer data)
       (GCallback) test_session_basic_exported_object_added, fixture);
   g_signal_connect (fixture->export_om, "object-removed",
       (GCallback) test_session_basic_exported_object_removed, fixture);
-  wp_object_manager_add_interest (fixture->export_om,
-      WP_TYPE_IMPL_SESSION, NULL,
-      WP_SESSION_FEATURES_STANDARD);
+  wp_object_manager_add_interest_1 (fixture->export_om,
+      WP_TYPE_IMPL_SESSION, NULL);
+  wp_object_manager_request_proxy_features (fixture->export_om,
+      WP_TYPE_IMPL_SESSION, WP_SESSION_FEATURES_STANDARD);
   wp_core_install_object_manager (fixture->base.core, fixture->export_om);
 
   /* set up the proxy side */
@@ -160,9 +161,9 @@ test_session_basic (TestSessionFixture *fixture, gconstpointer data)
       (GCallback) test_session_basic_proxy_object_added, fixture);
   g_signal_connect (fixture->proxy_om, "object-removed",
       (GCallback) test_session_basic_proxy_object_removed, fixture);
-  wp_object_manager_add_interest (fixture->proxy_om,
-      WP_TYPE_SESSION, NULL,
-      WP_SESSION_FEATURES_STANDARD);
+  wp_object_manager_add_interest_1 (fixture->proxy_om, WP_TYPE_SESSION, NULL);
+  wp_object_manager_request_proxy_features (fixture->proxy_om,
+      WP_TYPE_SESSION, WP_SESSION_FEATURES_STANDARD);
   wp_core_install_object_manager (fixture->base.client_core, fixture->proxy_om);
 
   /* create session */
-- 
GitLab