aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-ops.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-05-08 04:38:32 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-05-08 04:38:32 +0800
commit16e2beab9e4d412399f495f6165d27da80cb3675 (patch)
tree61946c02feb6e8187ef5368a9ddbcf15770cfe06 /mail/mail-ops.c
parent84080821d62db3358fcaee4adfc24782ed7d4318 (diff)
downloadgsoc2013-evolution-16e2beab9e4d412399f495f6165d27da80cb3675.tar
gsoc2013-evolution-16e2beab9e4d412399f495f6165d27da80cb3675.tar.gz
gsoc2013-evolution-16e2beab9e4d412399f495f6165d27da80cb3675.tar.bz2
gsoc2013-evolution-16e2beab9e4d412399f495f6165d27da80cb3675.tar.lz
gsoc2013-evolution-16e2beab9e4d412399f495f6165d27da80cb3675.tar.xz
gsoc2013-evolution-16e2beab9e4d412399f495f6165d27da80cb3675.tar.zst
gsoc2013-evolution-16e2beab9e4d412399f495f6165d27da80cb3675.zip
Adapt mail to EShellBackend changes.
Again, builds but not tested. Lots of compiler warnings to clean up, but I don't have the energy for it. This was pretty grueling.
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r--mail/mail-ops.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index 97df0ed9bd..63175d73d6 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -69,7 +69,7 @@
#include "mail-tools.h"
#include "mail-vfolder.h"
-#include "e-mail-shell-module.h"
+#include "e-mail-shell-backend.h"
#define w(x)
#define d(x)
@@ -244,16 +244,19 @@ static char *
uid_cachename_hack (CamelStore *store)
{
CamelURL *url = CAMEL_SERVICE (store)->url;
+ EShellBackend *shell_backend;
char *encoded_url, *filename;
const gchar *data_dir;
+ shell_backend = E_SHELL_BACKEND (global_mail_shell_backend);
+
encoded_url = g_strdup_printf ("%s%s%s@%s", url->user,
url->authmech ? ";auth=" : "",
url->authmech ? url->authmech : "",
url->host);
e_filename_make_safe (encoded_url);
- data_dir = e_shell_module_get_data_dir (mail_shell_module);
+ data_dir = e_shell_backend_get_data_dir (shell_backend);
filename = g_build_filename (data_dir, "pop", encoded_url, "uid-cache", NULL);
g_free (encoded_url);
@@ -275,8 +278,8 @@ fetch_mail_exec (struct _fetch_mail_msg *m)
if (m->cancel)
camel_operation_register (m->cancel);
- fm->destination = e_mail_shell_module_get_folder (
- mail_shell_module, E_MAIL_FOLDER_LOCAL_INBOX);
+ fm->destination = e_mail_shell_backend_get_folder (
+ global_mail_shell_backend, E_MAIL_FOLDER_LOCAL_INBOX);
if (fm->destination == NULL)
goto fail;
camel_object_ref (fm->destination);
@@ -581,8 +584,8 @@ mail_send_message(CamelFolder *queue, const char *uid, const char *destination,
}
if (!folder) {
- folder = e_mail_shell_module_get_folder (
- mail_shell_module, E_MAIL_FOLDER_SENT);
+ folder = e_mail_shell_backend_get_folder (
+ global_mail_shell_backend, E_MAIL_FOLDER_SENT);
camel_object_ref(folder);
}
@@ -595,8 +598,8 @@ mail_send_message(CamelFolder *queue, const char *uid, const char *destination,
if (camel_exception_get_id (ex) == CAMEL_EXCEPTION_USER_CANCEL)
goto exit;
- sent_folder = e_mail_shell_module_get_folder (
- mail_shell_module, E_MAIL_FOLDER_SENT);
+ sent_folder = e_mail_shell_backend_get_folder (
+ global_mail_shell_backend, E_MAIL_FOLDER_SENT);
if (folder != sent_folder) {
const char *name;
@@ -698,8 +701,8 @@ send_queue_exec (struct _send_queue_msg *m)
d(printf("sending queue\n"));
- sent_folder = e_mail_shell_module_get_folder (
- mail_shell_module, E_MAIL_FOLDER_SENT);
+ sent_folder = e_mail_shell_backend_get_folder (
+ global_mail_shell_backend, E_MAIL_FOLDER_SENT);
if (!(uids = camel_folder_get_uids (m->queue)))
return;
@@ -1761,14 +1764,17 @@ empty_trash_desc (struct _empty_trash_msg *m)
static void
empty_trash_exec (struct _empty_trash_msg *m)
{
+ EShellBackend *shell_backend;
const gchar *data_dir;
CamelFolder *trash;
char *uri;
+ shell_backend = E_SHELL_BACKEND (global_mail_shell_backend);
+
if (m->account) {
trash = mail_tool_get_trash (m->account->source->url, FALSE, &m->base.ex);
} else {
- data_dir = e_shell_module_get_data_dir (mail_shell_module);
+ data_dir = e_shell_backend_get_data_dir (shell_backend);
uri = g_strdup_printf ("mbox:%s/local", data_dir);
trash = mail_tool_get_trash (uri, TRUE, &m->base.ex);
g_free (uri);