Commit da63c05e authored by Julian Bouzas's avatar Julian Bouzas
Browse files

m-config-static-nodes: remove unneeded 'conected' callback and create static...

m-config-static-nodes: remove unneeded 'conected' callback and create static nodes when the plugin is activated
parent 9667cccb
......@@ -113,25 +113,13 @@ parser_node_foreach_func (const struct WpParserNodeData *node_data,
return TRUE;
}
static void
start_static_nodes (WpConfigStaticNodesContext *self)
{
g_autoptr (WpCore) core = wp_plugin_get_core (WP_PLUGIN (self));
g_autoptr (WpConfiguration) config = wp_configuration_get_instance (core);
g_autoptr (WpConfigParser) parser =
wp_configuration_get_parser (config, WP_PARSER_NODE_EXTENSION);
/* Create static nodes without match-device */
wp_parser_node_foreach (WP_PARSER_NODE (parser), parser_node_foreach_func,
self);
}
static void
wp_config_static_nodes_context_activate (WpPlugin * plugin)
{
WpConfigStaticNodesContext *self = WP_CONFIG_STATIC_NODES_CONTEXT (plugin);
g_autoptr (WpCore) core = wp_plugin_get_core (plugin);
g_autoptr (WpConfiguration) config = wp_configuration_get_instance (core);
g_autoptr (WpConfigParser) parser = NULL;
/* Add the node parser and parse the node files */
wp_configuration_add_extension (config, WP_PARSER_NODE_EXTENSION,
......@@ -141,9 +129,10 @@ wp_config_static_nodes_context_activate (WpPlugin * plugin)
/* Install the object manager */
wp_core_install_object_manager (core, self->devices_om);
/* Start creating static nodes when the connected callback is triggered */
g_signal_connect_object (core, "connected", (GCallback) start_static_nodes,
self, G_CONNECT_SWAPPED);
/* Create static nodes without match-device */
parser = wp_configuration_get_parser (config, WP_PARSER_NODE_EXTENSION);
wp_parser_node_foreach (WP_PARSER_NODE (parser), parser_node_foreach_func,
self);
}
static void
......
......@@ -16,7 +16,7 @@ static void
config_static_nodes_setup (TestConfigStaticNodesFixture *self,
gconstpointer data)
{
wp_base_test_fixture_setup (&self->base, WP_BASE_TEST_FLAG_DONT_CONNECT);
wp_base_test_fixture_setup (&self->base, 0);
/* load audioconvert plugin */
pw_thread_loop_lock (self->base.server.thread_loop);
......@@ -67,9 +67,6 @@ basic (TestConfigStaticNodesFixture *f, gconstpointer data)
/* Activate */
wp_plugin_activate (ctx);
/* Connect */
g_assert_true (wp_core_connect (f->base.core));
/* Run the main loop */
g_main_loop_run (f->base.loop);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment