diff options
Diffstat (limited to 'e-util/e-plugin.c')
-rw-r--r-- | e-util/e-plugin.c | 16 |
1 files changed, 10 insertions, 6 deletions
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) |