diff options
Diffstat (limited to 'mail/mail-tools.c')
-rw-r--r-- | mail/mail-tools.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/mail/mail-tools.c b/mail/mail-tools.c index a256e7e107..1dc96f702e 100644 --- a/mail/mail-tools.c +++ b/mail/mail-tools.c @@ -51,7 +51,6 @@ #include "em-utils.h" #include "em-vfolder-context.h" #include "em-vfolder-rule.h" -#include "mail-component.h" #include "mail-config.h" #include "mail-folder-cache.h" #include "mail-mt.h" @@ -59,6 +58,8 @@ #include "mail-tools.h" #include "mail-vfolder.h" +#include "e-mail-shell-backend.h" + /* **************************************** */ CamelFolder * @@ -106,7 +107,9 @@ mail_tool_get_trash (const gchar *url, int connect, CamelException *ex) static char * mail_tool_get_local_movemail_path (const unsigned char *uri, CamelException *ex) { + EShellBackend *shell_backend; unsigned char *safe_uri, *c; + const gchar *data_dir; char *path, *full; struct stat st; @@ -115,7 +118,10 @@ mail_tool_get_local_movemail_path (const unsigned char *uri, CamelException *ex) if (strchr("/:;=|%&#!*^()\\, ", *c) || !isprint((int) *c)) *c = '_'; - path = g_strdup_printf("%s/spool", mail_component_peek_base_directory(NULL)); + shell_backend = E_SHELL_BACKEND (global_mail_shell_backend); + data_dir = e_shell_backend_get_data_dir (shell_backend); + path = g_build_filename (data_dir, "spool", NULL); + if (g_stat(path, &st) == -1 && g_mkdir_with_parents(path, 0777) == -1) { camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Could not create spool directory `%s': %s"), path, g_strerror(errno)); |