[gthumb] avoid to activate non-required extensions
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] avoid to activate non-required extensions
- Date: Wed, 22 Sep 2010 16:11:08 +0000 (UTC)
commit 855be4326df6f7e3cbeb9bbc0cf65e8275fe05a1
Author: Paolo Bacchilega <paobac src gnome org>
Date: Wed Sep 22 18:07:31 2010 +0200
avoid to activate non-required extensions
do not activiate the hidden extensions explicitly, they will
be activated if required by other extensions.
gthumb/gth-main.c | 20 ++++++++++++++------
1 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/gthumb/gth-main.c b/gthumb/gth-main.c
index e47aa8c..9b8b655 100644
--- a/gthumb/gth-main.c
+++ b/gthumb/gth-main.c
@@ -1246,9 +1246,10 @@ gth_main_activate_extensions (void)
"slideshow",
"webalbums",
NULL };
- int i;
- GSList *active_extensions;
- GSList *scan;
+ int i;
+ GSList *active_extensions;
+ GthExtensionManager *manager;
+ GSList *scan;
if (Main->priv->extension_manager == NULL)
Main->priv->extension_manager = gth_extension_manager_new ();
@@ -1266,11 +1267,18 @@ gth_main_activate_extensions (void)
if (active_extensions == NULL)
for (i = 0; default_extensions[i] != NULL; i++)
active_extensions = g_slist_prepend (active_extensions, g_strdup (default_extensions[i]));
-
active_extensions = gth_extension_manager_order_extensions (Main->priv->extension_manager, active_extensions);
+
+ manager = gth_main_get_default_extension_manager ();
+
for (scan = active_extensions; scan; scan = scan->next) {
- char *name = scan->data;
- GError *error = NULL;
+ char *name = scan->data;
+ GthExtensionDescription *description;
+ GError *error = NULL;
+
+ description = gth_extension_manager_get_description (manager, name);
+ if ((description != NULL) && (description->hidden || description->mandatory))
+ continue;
if (! gth_extension_manager_activate (Main->priv->extension_manager, name, &error)) {
g_warning ("Could not load the '%s' extension: %s", name, error->message);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]