diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-08-29 08:21:54 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-08-30 05:23:20 +0800 |
commit | 32f545cdf031ebe3718791f18e8fb6b6141fd081 (patch) | |
tree | 980723161c32da855ca91b135318d7fa67dc18c7 /modules/mail/e-mail-shell-backend.c | |
parent | e8382099228d46ebef684c5384bab6ec710283ce (diff) | |
download | gsoc2013-evolution-32f545cdf031ebe3718791f18e8fb6b6141fd081.tar gsoc2013-evolution-32f545cdf031ebe3718791f18e8fb6b6141fd081.tar.gz gsoc2013-evolution-32f545cdf031ebe3718791f18e8fb6b6141fd081.tar.bz2 gsoc2013-evolution-32f545cdf031ebe3718791f18e8fb6b6141fd081.tar.lz gsoc2013-evolution-32f545cdf031ebe3718791f18e8fb6b6141fd081.tar.xz gsoc2013-evolution-32f545cdf031ebe3718791f18e8fb6b6141fd081.tar.zst gsoc2013-evolution-32f545cdf031ebe3718791f18e8fb6b6141fd081.zip |
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.
Diffstat (limited to 'modules/mail/e-mail-shell-backend.c')
-rw-r--r-- | modules/mail/e-mail-shell-backend.c | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/modules/mail/e-mail-shell-backend.c b/modules/mail/e-mail-shell-backend.c index 2d6e1a9779..fd1e7263c4 100644 --- a/modules/mail/e-mail-shell-backend.c +++ b/modules/mail/e-mail-shell-backend.c @@ -42,7 +42,6 @@ #include "e-mail-shell-sidebar.h" #include "e-mail-shell-view.h" -#include "e-attachment-handler-mail.h" #include "e-mail-browser.h" #include "e-mail-local.h" #include "e-mail-reader.h" @@ -51,12 +50,9 @@ #include "em-account-prefs.h" #include "em-composer-prefs.h" #include "em-composer-utils.h" -#include "em-config.h" -#include "em-event.h" #include "em-folder-utils.h" #include "em-format-hook.h" #include "em-format-html-display.h" -#include "em-junk-hook.h" #include "em-mailer-prefs.h" #include "em-network-prefs.h" #include "em-utils.h" @@ -85,22 +81,6 @@ static GType mail_shell_backend_type; extern gint camel_application_is_exiting; static void -mail_shell_backend_init_hooks (void) -{ - e_plugin_hook_register_type (em_config_hook_get_type ()); - e_plugin_hook_register_type (em_event_hook_get_type ()); - e_plugin_hook_register_type (em_junk_hook_get_type ()); - - /* EMFormat classes must be registered before EMFormatHook. */ - em_format_hook_register_type (em_format_get_type ()); - em_format_hook_register_type (em_format_html_get_type ()); - em_format_hook_register_type (em_format_html_display_get_type ()); - e_plugin_hook_register_type (em_format_hook_get_type ()); - - em_junk_hook_register_type (emj_get_type ()); -} - -static void mail_shell_backend_init_importers (void) { EImportClass *import_class; @@ -812,10 +792,15 @@ mail_shell_backend_constructed (GObject *object) /* This also initializes Camel, so it needs to happen early. */ mail_session_init (shell_backend); - mail_shell_backend_init_hooks (); - mail_shell_backend_init_importers (); + /* Register format types for EMFormatHook. */ + em_format_hook_register_type (em_format_get_type ()); + em_format_hook_register_type (em_format_html_get_type ()); + em_format_hook_register_type (em_format_html_display_get_type ()); + + /* Register plugin hook types. */ + em_format_hook_get_type (); - e_attachment_handler_mail_get_type (); + mail_shell_backend_init_importers (); g_signal_connect ( shell, "notify::online", |