From 2574884bdd9ea8d1a04f6e4abaf914422c30e66b Mon Sep 17 00:00:00 2001 From: Sankar P Date: Tue, 7 Aug 2007 08:01:21 +0000 Subject: reviewed by: Srinivasa Ragavan 2007-08-07 Sankar P reviewed by: Srinivasa Ragavan * e-plugin.c: (ep_load_pending): Do not load pending hooks, if the corresponding plugin is disabled. Fixes #383684 svn path=/trunk/; revision=33963 --- e-util/ChangeLog | 9 +++++++++ e-util/e-plugin.c | 16 ++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/e-util/ChangeLog b/e-util/ChangeLog index bd2b5f79b1..9c2a4fb489 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,12 @@ +2007-08-07 Sankar P + + reviewed by: Srinivasa Ragavan + + * e-plugin.c: (ep_load_pending): + Do not load pending hooks, + if the corresponding plugin is disabled. + Fixes #383684 + 2007-07-29 Hiroyuki Ikezoe ** Fix for bug #451211. diff --git a/e-util/e-plugin.c b/e-util/e-plugin.c index 28d6c962fa..89bcb0b666 100644 --- a/e-util/e-plugin.c +++ b/e-util/e-plugin.c @@ -438,12 +438,16 @@ ep_load_pending(EPlugin *ep, EPluginHookClass *type) if (class) { if (strcmp(class, type->id) == 0) { hook = g_object_new(G_OBJECT_CLASS_TYPE(type), NULL); - res = type->construct(hook, ep, node); - if (res == -1) { - g_warning("Plugin '%s' failed to load hook '%s'", ep->name, type->id); - g_object_unref(hook); - } else { - ep->hooks = g_slist_append(ep->hooks, hook); + + /* Don't bother loading hooks for plugins that are not anyway enabled */ + if (ep->enabled) { + res = type->construct(hook, ep, node); + if (res == -1) { + g_warning("Plugin '%s' failed to load hook '%s'", ep->name, type->id); + g_object_unref(hook); + } else { + ep->hooks = g_slist_append(ep->hooks, hook); + } } if (p) -- cgit v1.2.3