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 /plugins/sa-junk-plugin | |
parent | e8382099228d46ebef684c5384bab6ec710283ce (diff) | |
download | gsoc2013-evolution-32f545cdf031ebe3718791f18e8fb6b6141fd081.tar.gz 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 'plugins/sa-junk-plugin')
-rw-r--r-- | plugins/sa-junk-plugin/em-junk-filter.c | 18 | ||||
-rw-r--r-- | plugins/sa-junk-plugin/org-gnome-sa-junk-plugin.eplug.xml | 16 |
2 files changed, 16 insertions, 18 deletions
diff --git a/plugins/sa-junk-plugin/em-junk-filter.c b/plugins/sa-junk-plugin/em-junk-filter.c index 74010f2555..ff38f18d6a 100644 --- a/plugins/sa-junk-plugin/em-junk-filter.c +++ b/plugins/sa-junk-plugin/em-junk-filter.c @@ -42,7 +42,7 @@ #include <camel/camel-stream-fs.h> #include <camel/camel-stream-mem.h> #include <camel/camel-i18n.h> -#include <mail/em-junk-hook.h> +#include <mail/em-junk.h> #include <mail/em-utils.h> #include <e-util/e-mktemp.h> @@ -58,10 +58,10 @@ static pthread_mutex_t em_junk_sa_report_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t em_junk_sa_preferred_socket_path_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t em_junk_sa_spamd_restart_lock = PTHREAD_MUTEX_INITIALIZER; -gint e_plugin_lib_enable (EPluginLib *ep, gint enable); -gboolean em_junk_sa_check_junk (EPlugin *ep, EMJunkHookTarget *target); -void em_junk_sa_report_junk (EPlugin *ep, EMJunkHookTarget *target); -void em_junk_sa_report_non_junk (EPlugin *ep, EMJunkHookTarget *target); +gint e_plugin_lib_enable (EPlugin *ep, gint enable); +gboolean em_junk_sa_check_junk (EPlugin *ep, EMJunkTarget *target); +void em_junk_sa_report_junk (EPlugin *ep, EMJunkTarget *target); +void em_junk_sa_report_non_junk (EPlugin *ep, EMJunkTarget *target); void em_junk_sa_commit_reports (EPlugin *ep); gpointer em_junk_sa_validate_binary (EPlugin *ep); GtkWidget *org_gnome_sa_use_remote_tests (struct _EPlugin *epl, struct _EConfigHookItemFactoryData *data); @@ -571,7 +571,7 @@ em_junk_sa_respawn_spamd () } gboolean -em_junk_sa_check_junk(EPlugin *ep, EMJunkHookTarget *target) +em_junk_sa_check_junk(EPlugin *ep, EMJunkTarget *target) { GByteArray *out = NULL; const gchar *argv[7]; @@ -675,7 +675,7 @@ get_spamassassin_version () } void -em_junk_sa_report_junk (EPlugin *ep, EMJunkHookTarget *target) +em_junk_sa_report_junk (EPlugin *ep, EMJunkTarget *target) { const gchar *sync_op = (get_spamassassin_version () >= 3) @@ -715,7 +715,7 @@ em_junk_sa_report_junk (EPlugin *ep, EMJunkHookTarget *target) } void -em_junk_sa_report_non_junk (EPlugin *ep, EMJunkHookTarget *target) +em_junk_sa_report_non_junk (EPlugin *ep, EMJunkTarget *target) { const gchar *sync_op = (get_spamassassin_version () >= 3) @@ -812,7 +812,7 @@ em_junk_sa_setting_notify(GConfClient *gconf, guint cnxn_id, GConfEntry *entry, } gint -e_plugin_lib_enable (EPluginLib *ep, gint enable) +e_plugin_lib_enable (EPlugin *ep, gint enable) { em_junk_sa_init(); diff --git a/plugins/sa-junk-plugin/org-gnome-sa-junk-plugin.eplug.xml b/plugins/sa-junk-plugin/org-gnome-sa-junk-plugin.eplug.xml index 3403a3b8aa..83ed170c74 100644 --- a/plugins/sa-junk-plugin/org-gnome-sa-junk-plugin.eplug.xml +++ b/plugins/sa-junk-plugin/org-gnome-sa-junk-plugin.eplug.xml @@ -6,14 +6,12 @@ <_description>Filter junk messages using SpamAssassin.</_description> <author name="Vivek Jain" email="jvivek@novell.com"/> <hook class="org.gnome.evolution.mail.junk:1.0"> - <group id="EMJunk" > - <item name="SpamAssassin" - check_junk="em_junk_sa_check_junk" - report_junk="em_junk_sa_report_junk" - report_non_junk="em_junk_sa_report_non_junk" - commit_reports="em_junk_sa_commit_reports" - validate_binary="em_junk_sa_validate_binary"/> - </group> + <interface name="SpamAssassin" + check_junk="em_junk_sa_check_junk" + report_junk="em_junk_sa_report_junk" + report_non_junk="em_junk_sa_report_non_junk" + commit_reports="em_junk_sa_commit_reports" + validate_binary="em_junk_sa_validate_binary"/> </hook> <!-- hook into the 'mail properties' menu --> <hook class="org.gnome.evolution.mail.config:1.0"> @@ -21,6 +19,6 @@ <item type="section_table" path="40.junk/10.options" _label="SpamAssassin Options"/> <item type="item_table" path="40.junk/20.options" factory="org_gnome_sa_use_remote_tests"/> </group> - </hook> + </hook> </e-plugin> </e-plugin-list> |