aboutsummaryrefslogtreecommitdiffstats
path: root/modules/mail/e-mail-shell-view-private.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-12-16 23:40:37 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-12-16 23:58:54 +0800
commita9cfed5938aef37d95c009411f965ebc185547c1 (patch)
treed0c6eb1d5acea6752425169aae47e8f4ed4b55ea /modules/mail/e-mail-shell-view-private.c
parentdf85cb1b7a47f713cb775f648f735e642a1bb71b (diff)
downloadgsoc2013-evolution-a9cfed5938aef37d95c009411f965ebc185547c1.tar.gz
gsoc2013-evolution-a9cfed5938aef37d95c009411f965ebc185547c1.tar.zst
gsoc2013-evolution-a9cfed5938aef37d95c009411f965ebc185547c1.zip
Avoid passing EMailBackend as much as possible.
More mail API churn... reversing some previous API decisions. I've made some key API changes to EMailSession on the account-mgmt branch which should allow for this, and will hopefully also benefit the "email-factory" branch. EMailBackend barely needs to exist anymore, except as the owner of EMailSession. For several low-level functions, we replace its EMailBackend parameter with EMailSession and EAlertSink parameters; the latter so it can still pass user alerts up the chain.
Diffstat (limited to 'modules/mail/e-mail-shell-view-private.c')
-rw-r--r--modules/mail/e-mail-shell-view-private.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/modules/mail/e-mail-shell-view-private.c b/modules/mail/e-mail-shell-view-private.c
index 05488156a7..aaa4e5e4f3 100644
--- a/modules/mail/e-mail-shell-view-private.c
+++ b/modules/mail/e-mail-shell-view-private.c
@@ -1096,6 +1096,7 @@ e_mail_shell_view_send_receive (EMailShellView *mail_shell_view,
EShellWindow *shell_window;
EShellBackend *shell_backend;
EMailBackend *backend;
+ EMailSession *session;
g_return_if_fail (mail_shell_view != NULL);
@@ -1104,25 +1105,25 @@ e_mail_shell_view_send_receive (EMailShellView *mail_shell_view,
shell_backend = e_shell_view_get_shell_backend (shell_view);
backend = E_MAIL_BACKEND (shell_backend);
+ session = e_mail_backend_get_session (backend);
em_utils_clear_get_password_canceled_accounts_flag ();
if (!account_uid) {
switch (mode) {
case E_MAIL_SEND_RECEIVE_BOTH:
- mail_send_receive (GTK_WINDOW (shell_window), backend);
+ mail_send_receive (GTK_WINDOW (shell_window), session);
break;
case E_MAIL_SEND_RECEIVE_RECEIVE:
- mail_receive (GTK_WINDOW (shell_window), backend);
+ mail_receive (GTK_WINDOW (shell_window), session);
break;
case E_MAIL_SEND_RECEIVE_SEND:
- mail_send (backend);
+ mail_send (session);
break;
}
} else {
/* allow only receive on individual accounts */
EAccount *account;
- EMailSession *session;
CamelService *service;
account = e_get_account_by_uid (account_uid);
@@ -1131,13 +1132,10 @@ e_mail_shell_view_send_receive (EMailShellView *mail_shell_view,
if (!account->enabled)
return;
- session = e_mail_backend_get_session (backend);
-
service = camel_session_get_service (
CAMEL_SESSION (session), account->uid);
- if (CAMEL_IS_SERVICE (service))
- mail_receive_service (backend, service);
+ mail_receive_service (service);
}
}