diff options
Diffstat (limited to 'mail/mail-autofilter.c')
-rw-r--r-- | mail/mail-autofilter.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/mail/mail-autofilter.c b/mail/mail-autofilter.c index 53a0411f08..f195ebf5d1 100644 --- a/mail/mail-autofilter.c +++ b/mail/mail-autofilter.c @@ -32,7 +32,6 @@ #include "mail-vfolder.h" #include "mail-autofilter.h" -#include "mail-component.h" #include "em-utils.h" #include "e-util/e-error.h" #include "e-util/e-util-private.h" @@ -49,6 +48,8 @@ #include <camel/camel-internet-address.h> #include <camel/camel-mime-message.h> +#include "e-mail-shell-backend.h" + #define d(x) static void @@ -345,15 +346,19 @@ filter_rule_from_message (EMFilterContext *context, CamelMimeMessage *msg, int f void filter_gui_add_from_message (CamelMimeMessage *msg, const char *source, int flags) { + EShellBackend *shell_backend; EMFilterContext *fc; + const gchar *data_dir; char *user, *system; FilterRule *rule; g_return_if_fail (msg != NULL); + shell_backend = E_SHELL_BACKEND (global_mail_shell_backend); + fc = em_filter_context_new (); - user = g_strdup_printf ("%s/filters.xml", - mail_component_peek_base_directory (mail_component_peek ())); + data_dir = e_shell_backend_get_data_dir (shell_backend); + user = g_build_filename (data_dir, "filters.xml", NULL); system = g_build_filename (EVOLUTION_PRIVDATADIR, "filtertypes.xml", NULL); rule_context_load ((RuleContext *)fc, system, user); g_free (system); @@ -370,7 +375,9 @@ filter_gui_add_from_message (CamelMimeMessage *msg, const char *source, int flag void mail_filter_rename_uri(CamelStore *store, const char *olduri, const char *newuri) { + EShellBackend *shell_backend; EMFilterContext *fc; + const gchar *data_dir; char *user, *system; GList *changed; char *eolduri, *enewuri; @@ -378,8 +385,11 @@ mail_filter_rename_uri(CamelStore *store, const char *olduri, const char *newuri eolduri = em_uri_from_camel(olduri); enewuri = em_uri_from_camel(newuri); + shell_backend = E_SHELL_BACKEND (global_mail_shell_backend); + fc = em_filter_context_new (); - user = g_strdup_printf ("%s/filters.xml", mail_component_peek_base_directory (mail_component_peek ())); + data_dir = e_shell_backend_get_data_dir (shell_backend); + user = g_build_filename (data_dir, "filters.xml", NULL); system = g_build_filename (EVOLUTION_PRIVDATADIR, "filtertypes.xml", NULL); rule_context_load ((RuleContext *)fc, system, user); g_free (system); @@ -402,15 +412,20 @@ mail_filter_rename_uri(CamelStore *store, const char *olduri, const char *newuri void mail_filter_delete_uri(CamelStore *store, const char *uri) { + EShellBackend *shell_backend; EMFilterContext *fc; + const gchar *data_dir; char *user, *system; GList *deleted; char *euri; euri = em_uri_from_camel(uri); + shell_backend = E_SHELL_BACKEND (global_mail_shell_backend); + fc = em_filter_context_new (); - user = g_strdup_printf ("%s/filters.xml", mail_component_peek_base_directory (mail_component_peek ())); + data_dir = e_shell_backend_get_data_dir (shell_backend); + user = g_build_filename (data_dir, "filters.xml", NULL); system = g_build_filename (EVOLUTION_PRIVDATADIR, "filtertypes.xml", NULL); rule_context_load ((RuleContext *)fc, system, user); g_free (system); |