From 32f545cdf031ebe3718791f18e8fb6b6141fd081 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 28 Aug 2009 20:21:54 -0400 Subject: Simplify EPlugin loading at startup. - Require all EPlugin and EPluginHook subtypes be registered before loading plugins. This drastically simplifies the EPlugin/EPluginHook negotiation. - Turn most EPluginHook subtypes into GTypeModules and register their types from an e_module_load() function (does not include shell hooks). - Convert EPluginLib and the Mono and Python bindings to GTypeModules and register their types from an e_module_load() function, and kill EPluginTypeHook. --- mail/em-config.c | 82 -------------------------------------------------------- 1 file changed, 82 deletions(-) (limited to 'mail/em-config.c') diff --git a/mail/em-config.c b/mail/em-config.c index 357e88555b..dcdf9b10ef 100644 --- a/mail/em-config.c +++ b/mail/em-config.c @@ -223,85 +223,3 @@ em_config_target_new_account(EMConfig *emp, struct _EAccount *account) return t; } - -/* ********************************************************************** */ - -/* Popup menu plugin handler */ - -/* - - - - - - - -*/ - -static gpointer emph_parent_class; -#define emph ((EMConfigHook *)eph) - -static const EConfigHookTargetMask emph_no_masks[] = { - { NULL } -}; - -static const EConfigHookTargetMap emph_targets[] = { - { "folder", EM_CONFIG_TARGET_FOLDER, emph_no_masks }, - { "prefs", EM_CONFIG_TARGET_PREFS, emph_no_masks }, - { "account", EM_CONFIG_TARGET_ACCOUNT, emph_no_masks }, - { NULL } -}; - -static void -emph_finalise(GObject *o) -{ - /*EPluginHook *eph = (EPluginHook *)o;*/ - - ((GObjectClass *)emph_parent_class)->finalize(o); -} - -static void -emph_class_init(EPluginHookClass *klass) -{ - gint i; - - ((GObjectClass *)klass)->finalize = emph_finalise; - ((EPluginHookClass *)klass)->id = "org.gnome.evolution.mail.config:1.0"; - - for (i=0;emph_targets[i].type;i++) - e_config_hook_class_add_target_map((EConfigHookClass *)klass, &emph_targets[i]); - - ((EConfigHookClass *)klass)->config_class = g_type_class_ref(em_config_get_type()); -} - -GType -em_config_hook_get_type(void) -{ - static GType type = 0; - - if (!type) { - static const GTypeInfo info = { - sizeof(EMConfigHookClass), NULL, NULL, (GClassInitFunc) emph_class_init, NULL, NULL, - sizeof(EMConfigHook), 0, (GInstanceInitFunc) NULL, - }; - - emph_parent_class = g_type_class_ref(e_config_hook_get_type()); - type = g_type_register_static(e_config_hook_get_type(), "EMConfigHook", &info, 0); - } - - return type; -} -- cgit