[gnome-software] Only show the plugin loader state after all the plugins have been enabled
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Only show the plugin loader state after all the plugins have been enabled
- Date: Mon, 2 Sep 2013 10:30:57 +0000 (UTC)
commit e77e2d1bf3cbb55b58316e4d2425210c8a0bda5a
Author: Richard Hughes <richard hughsie com>
Date: Mon Sep 2 09:06:22 2013 +0100
Only show the plugin loader state after all the plugins have been enabled
src/gs-application.c | 3 +++
src/gs-plugin-loader.c | 30 +++++++++++++++++++-----------
src/gs-plugin-loader.h | 1 +
3 files changed, 23 insertions(+), 11 deletions(-)
---
diff --git a/src/gs-application.c b/src/gs-application.c
index ade3eba..962ce37 100644
--- a/src/gs-application.c
+++ b/src/gs-application.c
@@ -164,6 +164,9 @@ gs_application_startup (GApplication *application)
gs_plugin_loader_set_enabled (app->plugin_loader, "datadir-apps", TRUE);
gs_plugin_loader_set_enabled (app->plugin_loader, "datadir-filename", TRUE);
+ /* show the priority of each plugin */
+ gs_plugin_loader_dump_state (app->plugin_loader);
+
/* setup UI */
app->shell = gs_shell_new ();
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index 11b45c4..32d7f7b 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -1733,8 +1733,6 @@ gs_plugin_loader_setup (GsPluginLoader *plugin_loader, GError **error)
gboolean ret = TRUE;
gchar *filename_plugin;
GDir *dir;
- GsPlugin *plugin;
- guint i;
g_return_val_if_fail (plugin_loader->priv->location != NULL, FALSE);
@@ -1764,15 +1762,6 @@ gs_plugin_loader_setup (GsPluginLoader *plugin_loader, GError **error)
g_ptr_array_sort (plugin_loader->priv->plugins,
gs_plugin_loader_plugin_sort_fn);
- /* print what the priorities are */
- for (i = 0; i < plugin_loader->priv->plugins->len; i++) {
- plugin = g_ptr_array_index (plugin_loader->priv->plugins, i);
- g_debug ("%.1f\t->\t%s [%s]",
- plugin->priority,
- plugin->name,
- plugin->enabled ? "enabled" : "disabled");
- }
-
/* run the plugins */
gs_plugin_loader_run (plugin_loader, "gs_plugin_initialize");
out:
@@ -1782,6 +1771,25 @@ out:
}
/**
+ * gs_plugin_loader_dump_state:
+ **/
+void
+gs_plugin_loader_dump_state (GsPluginLoader *plugin_loader)
+{
+ GsPlugin *plugin;
+ guint i;
+
+ /* print what the priorities are */
+ for (i = 0; i < plugin_loader->priv->plugins->len; i++) {
+ plugin = g_ptr_array_index (plugin_loader->priv->plugins, i);
+ g_debug ("[%s]\t%.1f\t->\t%s",
+ plugin->enabled ? "enabled" : "disabled",
+ plugin->priority,
+ plugin->name);
+ }
+}
+
+/**
* gs_plugin_loader_plugin_free:
**/
static void
diff --git a/src/gs-plugin-loader.h b/src/gs-plugin-loader.h
index 2e5828f..5e6de5d 100644
--- a/src/gs-plugin-loader.h
+++ b/src/gs-plugin-loader.h
@@ -122,6 +122,7 @@ GList *gs_plugin_loader_search_finish (GsPluginLoader
*plugin_loader,
GError **error);
gboolean gs_plugin_loader_setup (GsPluginLoader *plugin_loader,
GError **error);
+void gs_plugin_loader_dump_state (GsPluginLoader *plugin_loader);
gboolean gs_plugin_loader_set_enabled (GsPluginLoader *plugin_loader,
const gchar *plugin_name,
gboolean enabled);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]