component-loader: pass core and cancellable parameters in load()

Regarding the core parameter, the case used to be that WpComponentLoader
was a WpPlugin, so it had a reference to the core internally, but since
this is no longer a requirement, we need to pass this explicitly
This commit is contained in:
George Kiagiadakis
2023-05-26 13:04:10 +03:00
parent eb180cebe8
commit 843e7ef4dd
15 changed files with 41 additions and 40 deletions

View File

@@ -94,7 +94,7 @@ wp_require_api_transition_execute_step (WpTransition * transition, guint step)
"libwireplumber-module-%s", api_name);
self->pending_plugins++;
wp_core_load_component (core, module_name, "module", NULL,
wp_core_load_component (core, module_name, "module", NULL, NULL,
(GAsyncReadyCallback) on_plugin_loaded, self);
}
}

View File

@@ -175,13 +175,12 @@ on_script_loaded (WpObject *object, GAsyncResult *res, gpointer data)
}
static void
wp_lua_scripting_plugin_load (WpComponentLoader * cl, const gchar * component,
const gchar * type, WpSpaJson * args, GAsyncReadyCallback callback,
gpointer data)
wp_lua_scripting_plugin_load (WpComponentLoader * cl, WpCore * core,
const gchar * component, const gchar * type, WpSpaJson * args,
GCancellable * cancellable, GAsyncReadyCallback callback, gpointer data)
{
WpLuaScriptingPlugin * self = WP_LUA_SCRIPTING_PLUGIN (cl);
g_autoptr (WpCore) core = wp_object_get_core (WP_OBJECT (cl));
g_autoptr (GTask) task = task = g_task_new (core, NULL, callback, data);
g_autoptr (GTask) task = task = g_task_new (core, cancellable, callback, data);
g_autofree gchar *filepath = NULL;
g_autofree gchar *pluginname = NULL;
g_autoptr (WpPlugin) script = NULL;