[gnome-software: 1/14] gs-plugin-loader: Expose shutdown() method publicly
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software: 1/14] gs-plugin-loader: Expose shutdown() method publicly
- Date: Wed, 2 Mar 2022 11:47:36 +0000 (UTC)
commit f6e7694596ac2557d87897a50de4578b2dafab77
Author: Philip Withnall <pwithnall endlessos org>
Date: Tue Mar 1 12:58:29 2022 +0000
gs-plugin-loader: Expose shutdown() method publicly
This is so it can be called directly from the unit tests in a following
commit.
Signed-off-by: Philip Withnall <pwithnall endlessos org>
Helps: #1661
lib/gs-plugin-loader.c | 22 +++++++++++++++++-----
lib/gs-plugin-loader.h | 4 ++++
2 files changed, 21 insertions(+), 5 deletions(-)
---
diff --git a/lib/gs-plugin-loader.c b/lib/gs-plugin-loader.c
index 4081a6910..a9592ad9b 100644
--- a/lib/gs-plugin-loader.c
+++ b/lib/gs-plugin-loader.c
@@ -2237,9 +2237,21 @@ static void plugin_shutdown_cb (GObject *source_object,
GAsyncResult *result,
gpointer user_data);
-static void
-gs_plugin_loader_call_shutdown (GsPluginLoader *plugin_loader,
- GCancellable *cancellable)
+/**
+ * gs_plugin_loader_shutdown:
+ * @plugin_loader: a #GsPluginLoader
+ * @cancellable: a #GCancellable, or %NULL
+ *
+ * Shut down the plugins.
+ *
+ * This blocks until the operation is complete. It may be refactored in future
+ * to be asynchronous.
+ *
+ * Since: 42
+ */
+void
+gs_plugin_loader_shutdown (GsPluginLoader *plugin_loader,
+ GCancellable *cancellable)
{
ShutdownData shutdown_data;
@@ -2310,7 +2322,7 @@ gs_plugin_loader_setup_again (GsPluginLoader *plugin_loader)
#endif
/* Shut down */
- gs_plugin_loader_call_shutdown (plugin_loader, NULL);
+ gs_plugin_loader_shutdown (plugin_loader, NULL);
/* clear global cache */
gs_plugin_loader_clear_caches (plugin_loader);
@@ -2672,7 +2684,7 @@ gs_plugin_loader_dispose (GObject *object)
if (plugin_loader->plugins != NULL) {
/* Shut down all the plugins first. */
- gs_plugin_loader_call_shutdown (plugin_loader, NULL);
+ gs_plugin_loader_shutdown (plugin_loader, NULL);
g_clear_pointer (&plugin_loader->plugins, g_ptr_array_unref);
}
diff --git a/lib/gs-plugin-loader.h b/lib/gs-plugin-loader.h
index 758389560..37cef9a2a 100644
--- a/lib/gs-plugin-loader.h
+++ b/lib/gs-plugin-loader.h
@@ -50,6 +50,10 @@ gboolean gs_plugin_loader_setup (GsPluginLoader *plugin_loader,
gchar **blocklist,
GCancellable *cancellable,
GError **error);
+
+void gs_plugin_loader_shutdown (GsPluginLoader *plugin_loader,
+ GCancellable *cancellable);
+
void gs_plugin_loader_dump_state (GsPluginLoader *plugin_loader);
gboolean gs_plugin_loader_get_enabled (GsPluginLoader *plugin_loader,
const gchar *plugin_name);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]