diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-09-27 13:13:42 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-09-27 21:31:13 +0800 |
commit | e2b6ff7a6c1e1580c26ee0719b349151e8dad6fd (patch) | |
tree | d2d2ce8eb509717d412ad3171059e470ff0e7030 /mail | |
parent | c520043a094d81d222aa0c3e23b0035ddb89d0bf (diff) | |
download | gsoc2013-evolution-e2b6ff7a6c1e1580c26ee0719b349151e8dad6fd.tar.gz gsoc2013-evolution-e2b6ff7a6c1e1580c26ee0719b349151e8dad6fd.tar.zst gsoc2013-evolution-e2b6ff7a6c1e1580c26ee0719b349151e8dad6fd.zip |
Miscellaneous cleanups from the account-mgmt branch.
Reducing diff noise so I can see important changes easier when comparing
branches. A few API changes, but nothing that affects functionality.
Diffstat (limited to 'mail')
-rw-r--r-- | mail/e-mail-backend.c | 14 | ||||
-rw-r--r-- | mail/e-mail-migrate.c | 12 | ||||
-rw-r--r-- | mail/e-mail-reader-utils.c | 5 | ||||
-rw-r--r-- | mail/e-mail-session-utils.c | 8 | ||||
-rw-r--r-- | mail/e-mail-session.c | 13 | ||||
-rw-r--r-- | mail/e-mail-store.c | 76 | ||||
-rw-r--r-- | mail/e-mail-store.h | 14 | ||||
-rw-r--r-- | mail/em-account-editor.c | 4 | ||||
-rw-r--r-- | mail/em-composer-utils.c | 51 | ||||
-rw-r--r-- | mail/em-composer-utils.h | 6 | ||||
-rw-r--r-- | mail/em-folder-tree-model.c | 9 | ||||
-rw-r--r-- | mail/em-folder-tree.c | 4 | ||||
-rw-r--r-- | mail/em-subscription-editor.c | 59 | ||||
-rw-r--r-- | mail/em-subscription-editor.h | 5 | ||||
-rw-r--r-- | mail/em-utils.c | 9 | ||||
-rw-r--r-- | mail/mail-folder-cache.c | 4 | ||||
-rw-r--r-- | mail/mail-ops.c | 36 | ||||
-rw-r--r-- | mail/mail-ops.h | 2 | ||||
-rw-r--r-- | mail/mail-send-recv.c | 96 | ||||
-rw-r--r-- | mail/mail-send-recv.h | 8 | ||||
-rw-r--r-- | mail/mail-vfolder.c | 2 | ||||
-rw-r--r-- | mail/message-list.c | 2 |
22 files changed, 240 insertions, 199 deletions
diff --git a/mail/e-mail-backend.c b/mail/e-mail-backend.c index 0c6590805f..5768934b1a 100644 --- a/mail/e-mail-backend.c +++ b/mail/e-mail-backend.c @@ -171,7 +171,7 @@ mail_backend_prepare_for_offline_cb (EShell *shell, } e_mail_store_foreach ( - session, (GFunc) mail_store_prepare_for_offline_cb, activity); + backend, (GFunc) mail_store_prepare_for_offline_cb, activity); } /* Helper for mail_backend_prepare_for_online_cb() */ @@ -197,7 +197,7 @@ mail_backend_prepare_for_online_cb (EShell *shell, camel_session_set_online (CAMEL_SESSION (session), TRUE); e_mail_store_foreach ( - session, (GFunc) mail_store_prepare_for_online_cb, activity); + backend, (GFunc) mail_store_prepare_for_online_cb, activity); } /* Helper for mail_backend_prepare_for_quit_cb() */ @@ -272,7 +272,6 @@ mail_backend_prepare_for_quit_cb (EShell *shell, EMailBackend *backend) { EAccountList *account_list; - EMailSession *session; gboolean delete_junk; gboolean empty_trash; @@ -281,8 +280,6 @@ mail_backend_prepare_for_quit_cb (EShell *shell, gboolean empty_trash; } sync_data; - session = e_mail_backend_get_session (backend); - delete_junk = e_mail_backend_delete_junk_policy_decision (backend); empty_trash = e_mail_backend_empty_trash_policy_decision (backend); @@ -298,13 +295,13 @@ mail_backend_prepare_for_quit_cb (EShell *shell, if (delete_junk) e_mail_store_foreach ( - session, (GFunc) mail_backend_delete_junk, backend); + backend, (GFunc) mail_backend_delete_junk, backend); sync_data.activity = activity; sync_data.empty_trash = empty_trash; e_mail_store_foreach ( - session, (GFunc) mail_backend_final_sync, &sync_data); + backend, (GFunc) mail_backend_final_sync, &sync_data); /* Now we poll until all activities are actually cancelled or finished. * Reffing the activity delays quitting; the reference count @@ -579,7 +576,8 @@ mail_backend_folder_changed_cb (MailFolderCache *folder_cache, if (target->new > 0) e_shell_event (e_shell_backend_get_shell (E_SHELL_BACKEND (mail_backend)), "mail-icon", (gpointer) "mail-unread"); - /** @Event: folder.changed + /** + * @Event: folder.changed * @Title: Folder changed * @Target: EMEventTargetFolder * diff --git a/mail/e-mail-migrate.c b/mail/e-mail-migrate.c index 07b2a8bb2c..10afa58e04 100644 --- a/mail/e-mail-migrate.c +++ b/mail/e-mail-migrate.c @@ -701,7 +701,6 @@ migrate_to_db (EShellBackend *shell_backend) EMMigrateSession *session; EAccountList *accounts; EMailBackend *mail_backend; - EMailSession *mail_session; EIterator *iter; gint i = 0, len; CamelStore *store = NULL; @@ -713,11 +712,10 @@ migrate_to_db (EShellBackend *shell_backend) return; mail_backend = E_MAIL_BACKEND (shell_backend); - mail_session = e_mail_backend_get_session (mail_backend); data_dir = e_shell_backend_get_data_dir (shell_backend); /* Initialize the mail stores early so we can add a new one. */ - e_mail_store_init (mail_session, data_dir); + e_mail_store_init (mail_backend, data_dir); iter = e_list_get_iterator ((EList *) accounts); len = e_list_length ((EList *) accounts); @@ -772,7 +770,7 @@ migrate_to_db (EShellBackend *shell_backend) && strncmp (service->url, "mbox:", 5) != 0) { store = e_mail_store_add_by_account ( - mail_session, account); + mail_backend, account); info = camel_store_get_folder_info_sync ( store, NULL, @@ -1020,7 +1018,6 @@ create_mbox_account (EShellBackend *shell_backend, EMMigrateSession *session) { EMailBackend *mail_backend; - EMailSession *mail_session; CamelStore *store; CamelURL *url; EAccountList *accounts; @@ -1029,11 +1026,10 @@ create_mbox_account (EShellBackend *shell_backend, gchar *name, *id, *temp, *uri, *folder_uri; mail_backend = E_MAIL_BACKEND (shell_backend); - mail_session = e_mail_backend_get_session (mail_backend); data_dir = e_shell_backend_get_data_dir (shell_backend); /* Initialize the mail stores early so we can add a new one. */ - e_mail_store_init (mail_session, data_dir); + e_mail_store_init (mail_backend, data_dir); account = e_account_new (); account->enabled = TRUE; @@ -1067,7 +1063,7 @@ create_mbox_account (EShellBackend *shell_backend, } e_account_list_add (accounts, account); - store = e_mail_store_add_by_account (mail_session, account); + store = e_mail_store_add_by_account (mail_backend, account); folder_uri = e_mail_folder_uri_build (store, "Sent"); e_account_set_string ( diff --git a/mail/e-mail-reader-utils.c b/mail/e-mail-reader-utils.c index 4cc9465c7d..725a0c6d7c 100644 --- a/mail/e-mail-reader-utils.c +++ b/mail/e-mail-reader-utils.c @@ -287,7 +287,6 @@ e_mail_reader_mark_as_read (EMailReader *reader, const gchar *uid) { EMailBackend *backend; - EMailSession *session; EMFormatHTML *formatter; CamelFolder *folder; guint32 mask, set; @@ -300,15 +299,13 @@ e_mail_reader_mark_as_read (EMailReader *reader, backend = e_mail_reader_get_backend (reader); formatter = e_mail_reader_get_formatter (reader); - session = e_mail_backend_get_session (backend); - flags = camel_folder_get_message_flags (folder, uid); if (!(flags & CAMEL_MESSAGE_SEEN)) { CamelMimeMessage *message; message = EM_FORMAT (formatter)->message; - em_utils_handle_receipt (session, folder, uid, message); + em_utils_handle_receipt (backend, folder, uid, message); } mask = CAMEL_MESSAGE_SEEN; diff --git a/mail/e-mail-session-utils.c b/mail/e-mail-session-utils.c index 55221249c4..217e7e2e8e 100644 --- a/mail/e-mail-session-utils.c +++ b/mail/e-mail-session-utils.c @@ -695,14 +695,14 @@ e_mail_session_send_to (EMailSession *session, sent_folder_uri = g_strdup (account->sent_folder_uri); } - string = camel_header_raw_find (&xev, "X-Evolution-Transport", NULL); - if (transport_uid == NULL && string != NULL) - transport_uid = g_strstrip (g_strdup (string)); - string = camel_header_raw_find (&xev, "X-Evolution-Fcc", NULL); if (sent_folder_uri == NULL && string != NULL) sent_folder_uri = g_strstrip (g_strdup (string)); + string = camel_header_raw_find (&xev, "X-Evolution-Transport", NULL); + if (transport_uid == NULL && string != NULL) + transport_uid = g_strstrip (g_strdup (string)); + post_to_uris = g_ptr_array_new (); for (header = xev; header != NULL; header = header->next) { gchar *folder_uri; diff --git a/mail/e-mail-session.c b/mail/e-mail-session.c index 333ee74477..d716357288 100644 --- a/mail/e-mail-session.c +++ b/mail/e-mail-session.c @@ -398,10 +398,17 @@ static guint preparing_flush = 0; static gboolean forward_to_flush_outbox_cb (EMailSession *session) { + EShell *shell; + EShellBackend *shell_backend; + g_return_val_if_fail (preparing_flush != 0, FALSE); + shell = e_shell_get_default (); + shell_backend = e_shell_get_backend_by_name (shell, "mail"); + g_return_val_if_fail (E_IS_MAIL_BACKEND (shell_backend), FALSE); + preparing_flush = 0; - mail_send (session); + mail_send (E_MAIL_BACKEND (shell_backend)); return FALSE; } @@ -458,8 +465,8 @@ set_socks_proxy_from_gsettings (CamelSession *session) static void proxy_gsettings_changed_cb (GSettings *settings, - const gchar *key, - CamelSession *session) + const gchar *key, + CamelSession *session) { set_socks_proxy_from_gsettings (session); } diff --git a/mail/e-mail-store.c b/mail/e-mail-store.c index fe54dd057c..885e34bc6b 100644 --- a/mail/e-mail-store.c +++ b/mail/e-mail-store.c @@ -182,10 +182,11 @@ special_mail_store_is_enabled (CamelStore *store) } static void -mail_store_add (EMailSession *session, +mail_store_add (EMailBackend *backend, CamelStore *store, AddStoreCallback callback) { + EMailSession *session; EMFolderTreeModel *default_model; MailFolderCache *folder_cache; StoreInfo *store_info; @@ -194,6 +195,7 @@ mail_store_add (EMailSession *session, g_return_if_fail (store != NULL); g_return_if_fail (CAMEL_IS_STORE (store)); + session = e_mail_backend_get_session (backend); default_model = em_folder_tree_model_get_default (); folder_cache = e_mail_session_get_folder_cache (session); @@ -228,23 +230,26 @@ mail_store_add_local_done_cb (MailFolderCache *folder_cache, } static void -mail_store_load_accounts (EMailSession *session, +mail_store_load_accounts (EMailBackend *backend, const gchar *data_dir) { CamelStore *local_store; + EMailSession *session; EAccountList *account_list; EIterator *iter; - /* Set up the local store. */ + session = e_mail_backend_get_session (backend); + + /* Add the local store. */ e_mail_local_init (session, data_dir); local_store = e_mail_local_get_store (); mail_store_add ( - session, local_store, (AddStoreCallback) + backend, local_store, (AddStoreCallback) mail_store_add_local_done_cb); - /* Set up remote stores. */ + /* Add mail accounts.. */ account_list = e_get_account_list (); @@ -257,19 +262,19 @@ mail_store_load_accounts (EMailSession *session, if (!account->enabled) continue; - e_mail_store_add_by_account (session, account); + e_mail_store_add_by_account (backend, account); } g_object_unref (iter); } void -e_mail_store_init (EMailSession *session, +e_mail_store_init (EMailBackend *backend, const gchar *data_dir) { static gboolean initialized = FALSE; - g_return_if_fail (E_IS_MAIL_SESSION (session)); + g_return_if_fail (E_IS_MAIL_BACKEND (backend)); /* This function is idempotent because mail * migration code may need to call it early. */ @@ -283,34 +288,37 @@ e_mail_store_init (EMailSession *session, (GDestroyNotify) NULL, (GDestroyNotify) store_table_free); - mail_store_load_accounts (session, data_dir); + mail_store_load_accounts (backend, data_dir); initialized = TRUE; } void -e_mail_store_add (EMailSession *session, +e_mail_store_add (EMailBackend *backend, CamelStore *store) { - g_return_if_fail (E_IS_MAIL_SESSION (session)); + g_return_if_fail (E_IS_MAIL_BACKEND (backend)); g_return_if_fail (CAMEL_IS_STORE (store)); - mail_store_add (session, store, NULL); + mail_store_add (backend, store, NULL); } CamelStore * -e_mail_store_add_by_account (EMailSession *session, +e_mail_store_add_by_account (EMailBackend *backend, EAccount *account) { + EMailSession *session; CamelService *service = NULL; CamelProvider *provider; CamelURL *url; gboolean skip, transport_only; GError *error = NULL; - g_return_val_if_fail (E_IS_MAIL_SESSION (session), NULL); + g_return_val_if_fail (E_IS_MAIL_BACKEND (backend), NULL); g_return_val_if_fail (E_IS_ACCOUNT (account), NULL); + session = e_mail_backend_get_session (backend); + /* check whether it's transport-only accounts */ transport_only = !account->source || !account->source->url || !*account->source->url; if (transport_only) @@ -376,7 +384,7 @@ handle_transport: } if (!skip && (provider->flags & CAMEL_PROVIDER_IS_STORAGE)) - e_mail_store_add (session, CAMEL_STORE (service)); + e_mail_store_add (backend, CAMEL_STORE (service)); return CAMEL_STORE (service); @@ -392,16 +400,19 @@ fail: } void -e_mail_store_remove (EMailSession *session, +e_mail_store_remove (EMailBackend *backend, CamelStore *store) { + EMailSession *session; MailFolderCache *folder_cache; EMFolderTreeModel *default_model; - g_return_if_fail (E_IS_MAIL_SESSION (session)); + g_return_if_fail (E_IS_MAIL_BACKEND (backend)); g_return_if_fail (CAMEL_IS_STORE (store)); g_return_if_fail (store_table != NULL); + session = e_mail_backend_get_session (backend); + /* Because the store table holds a reference to each store used * as a key in it, none of them will ever be gc'ed, meaning any * call to camel_session_get_{service,store} with the same URL @@ -426,43 +437,48 @@ e_mail_store_remove (EMailSession *session, } void -e_mail_store_remove_by_account (EMailSession *session, +e_mail_store_remove_by_account (EMailBackend *backend, EAccount *account) { + EMailSession *session; CamelService *service; CamelProvider *provider; + const gchar *uid; - g_return_if_fail (E_IS_MAIL_SESSION (session)); + g_return_if_fail (E_IS_MAIL_BACKEND (backend)); g_return_if_fail (E_IS_ACCOUNT (account)); - provider = camel_provider_get (account->source->url, NULL); - if (provider == NULL) - return; + uid = account->uid; + session = e_mail_backend_get_session (backend); - if (!(provider->flags & CAMEL_PROVIDER_IS_STORAGE)) - return; + service = camel_session_get_service (CAMEL_SESSION (session), uid); + g_return_if_fail (CAMEL_IS_STORE (service)); - service = camel_session_get_service ( - CAMEL_SESSION (session), account->uid); + provider = camel_service_get_provider (service); + g_return_if_fail (provider != NULL); - g_return_if_fail (CAMEL_IS_STORE (service)); + if (!(provider->flags & CAMEL_PROVIDER_IS_STORAGE)) + return; - e_mail_store_remove (session, CAMEL_STORE (service)); + e_mail_store_remove (backend, CAMEL_STORE (service)); } void -e_mail_store_foreach (EMailSession *session, +e_mail_store_foreach (EMailBackend *backend, GFunc func, gpointer user_data) { + EMailSession *session; GList *list, *link; /* XXX This is a silly convenience function. * Could probably just get rid of it. */ - g_return_if_fail (E_IS_MAIL_SESSION (session)); + g_return_if_fail (E_IS_MAIL_BACKEND (backend)); g_return_if_fail (func != NULL); + session = e_mail_backend_get_session (backend); + list = camel_session_list_services (CAMEL_SESSION (session)); for (link = list; link != NULL; link = g_list_next (link)) { diff --git a/mail/e-mail-store.h b/mail/e-mail-store.h index 5dca416e09..2c676d4fc4 100644 --- a/mail/e-mail-store.h +++ b/mail/e-mail-store.h @@ -23,22 +23,22 @@ #define E_MAIL_STORE_H #include <camel/camel.h> -#include <mail/e-mail-session.h> +#include <mail/e-mail-backend.h> #include <libedataserver/e-account.h> G_BEGIN_DECLS -void e_mail_store_init (EMailSession *session, +void e_mail_store_init (EMailBackend *backend, const gchar *data_dir); -void e_mail_store_add (EMailSession *session, +void e_mail_store_add (EMailBackend *backend, CamelStore *store); -CamelStore * e_mail_store_add_by_account (EMailSession *session, +CamelStore * e_mail_store_add_by_account (EMailBackend *backend, EAccount *account); -void e_mail_store_remove (EMailSession *session, +void e_mail_store_remove (EMailBackend *backend, CamelStore *store); -void e_mail_store_remove_by_account (EMailSession *session, +void e_mail_store_remove_by_account (EMailBackend *backend, EAccount *account); -void e_mail_store_foreach (EMailSession *session, +void e_mail_store_foreach (EMailBackend *backend, GFunc func, gpointer user_data); diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c index 5f2289ab58..8ec881b1f0 100644 --- a/mail/em-account-editor.c +++ b/mail/em-account-editor.c @@ -4108,11 +4108,9 @@ emae_commit (EConfig *ec, && emae->priv->source.provider && (emae->priv->source.provider->flags & CAMEL_PROVIDER_IS_STORAGE)) { EMailBackend *backend; - EMailSession *session; backend = em_account_editor_get_backend (emae); - session = e_mail_backend_get_session (backend); - e_mail_store_add_by_account (session, account); + e_mail_store_add_by_account (backend, account); } } diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c index 1dfa3c4a58..837cc31f62 100644 --- a/mail/em-composer-utils.c +++ b/mail/em-composer-utils.c @@ -1750,7 +1750,7 @@ em_utils_forward_messages (EMailReader *reader, CamelFolder *folder, GPtrArray *uids, EMailForwardStyle style, - GtkWidget *destroy_when_done) + GtkWidget *destroy_when_done) { EActivity *activity; AsyncContext *context; @@ -1846,7 +1846,7 @@ em_utils_redirect_message (EShell *shell, /* Message disposition notifications, rfc 2298 */ void -em_utils_handle_receipt (EMailSession *session, +em_utils_handle_receipt (EMailBackend *backend, CamelFolder *folder, const gchar *message_uid, CamelMimeMessage *message) @@ -1855,7 +1855,7 @@ em_utils_handle_receipt (EMailSession *session, const gchar *addr; CamelMessageInfo *info; - g_return_if_fail (E_IS_MAIL_SESSION (session)); + g_return_if_fail (E_IS_MAIL_BACKEND (backend)); g_return_if_fail (CAMEL_IS_FOLDER (folder)); g_return_if_fail (CAMEL_IS_MIME_MESSAGE (message)); @@ -1911,23 +1911,23 @@ em_utils_handle_receipt (EMailSession *session, return; } - em_utils_send_receipt (session, folder, message); + em_utils_send_receipt (backend, folder, message); } static void em_utils_receipt_done (CamelFolder *folder, GAsyncResult *result, - EMailSession *session) + EMailBackend *backend) { /* FIXME Poor error handling. */ if (!e_mail_folder_append_message_finish (folder, result, NULL, NULL)) return; - mail_send (session); + mail_send (backend); } void -em_utils_send_receipt (EMailSession *session, +em_utils_send_receipt (EMailBackend *backend, CamelFolder *folder, CamelMimeMessage *message) { @@ -2102,7 +2102,7 @@ em_utils_send_receipt (EMailSession *session, /* FIXME Pass a GCancellable. */ e_mail_folder_append_message ( out_folder, receipt, info, G_PRIORITY_DEFAULT, NULL, - (GAsyncReadyCallback) em_utils_receipt_done, session); + (GAsyncReadyCallback) em_utils_receipt_done, backend); camel_message_info_free (info); } @@ -2485,18 +2485,24 @@ concat_unique_addrs (CamelInternetAddress *dest, } } -static void -get_reply_all (CamelMimeMessage *message, - CamelInternetAddress *to, - CamelInternetAddress *cc, - CamelNNTPAddress *postto) +void +em_utils_get_reply_all (CamelMimeMessage *message, + CamelInternetAddress *to, + CamelInternetAddress *cc, + CamelNNTPAddress *postto) { - CamelInternetAddress *reply_to, *to_addrs, *cc_addrs; + CamelInternetAddress *reply_to; + CamelInternetAddress *to_addrs; + CamelInternetAddress *cc_addrs; CamelMedium *medium; const gchar *name, *addr; const gchar *posthdr = NULL; GHashTable *rcpt_hash; + g_return_if_fail (CAMEL_IS_MIME_MESSAGE (message)); + g_return_if_fail (CAMEL_IS_INTERNET_ADDRESS (to)); + g_return_if_fail (CAMEL_IS_INTERNET_ADDRESS (cc)); + medium = CAMEL_MEDIUM (message); /* check whether there is a 'Newsgroups: ' header in there */ @@ -2512,8 +2518,10 @@ get_reply_all (CamelMimeMessage *message, rcpt_hash = em_utils_generate_account_hash (); reply_to = get_reply_to (message); - to_addrs = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_TO); - cc_addrs = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_CC); + to_addrs = camel_mime_message_get_recipients ( + message, CAMEL_RECIPIENT_TYPE_TO); + cc_addrs = camel_mime_message_get_recipients ( + message, CAMEL_RECIPIENT_TYPE_CC); if (reply_to != NULL) { gint ii = 0; @@ -2556,15 +2564,6 @@ get_reply_all (CamelMimeMessage *message, g_hash_table_destroy (rcpt_hash); } -void -em_utils_get_reply_all (CamelMimeMessage *message, - CamelInternetAddress *to, - CamelInternetAddress *cc, - CamelNNTPAddress *postto) -{ - get_reply_all (message, to, cc, postto); -} - enum { ATTRIB_UNKNOWN, ATTRIB_CUSTOM, @@ -2947,7 +2946,7 @@ em_utils_reply_to_message (EShell *shell, if (folder) postto = camel_nntp_address_new (); - get_reply_all (message, to, cc, postto); + em_utils_get_reply_all (message, to, cc, postto); break; } diff --git a/mail/em-composer-utils.h b/mail/em-composer-utils.h index 3dba3e9216..bd6eb7cffd 100644 --- a/mail/em-composer-utils.h +++ b/mail/em-composer-utils.h @@ -25,9 +25,9 @@ #define EM_COMPOSER_UTILS_H #include <em-format/em-format.h> +#include <mail/e-mail-backend.h> #include <mail/e-mail-enums.h> #include <mail/e-mail-reader.h> -#include <mail/e-mail-session.h> #include <composer/e-msg-composer.h> G_BEGIN_DECLS @@ -58,11 +58,11 @@ void em_utils_forward_messages (EMailReader *reader, GtkWidget *destroy_when_done); void em_utils_redirect_message (EShell *shell, CamelMimeMessage *message); -void em_utils_handle_receipt (EMailSession *session, +void em_utils_handle_receipt (EMailBackend *backend, CamelFolder *folder, const gchar *message_uid, CamelMimeMessage *message); -void em_utils_send_receipt (EMailSession *session, +void em_utils_send_receipt (EMailBackend *backend, CamelFolder *folder, CamelMimeMessage *message); gchar * em_utils_construct_composer_text diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c index 5f8e9dd41d..1e7840710f 100644 --- a/mail/em-folder-tree-model.c +++ b/mail/em-folder-tree-model.c @@ -34,11 +34,11 @@ #include <errno.h> #include <sys/stat.h> +#include <glib/gi18n.h> + #include "e-util/e-util.h" #include "e-util/e-account-utils.h" -#include <glib/gi18n.h> - #include "mail-tools.h" #include "mail-mt.h" #include "mail-ops.h" @@ -288,12 +288,10 @@ account_added_cb (EAccountList *accounts, EMFolderTreeModel *model) { EMailBackend *backend; - EMailSession *session; backend = em_folder_tree_model_get_backend (model); - session = e_mail_backend_get_session (backend); - e_mail_store_add_by_account (session, account); + e_mail_store_add_by_account (backend, account); } static void @@ -458,7 +456,6 @@ folder_tree_model_get_property (GObject *object, G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } - static void folder_tree_model_dispose (GObject *object) { diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c index 061c3540f7..1d831cc4e4 100644 --- a/mail/em-folder-tree.c +++ b/mail/em-folder-tree.c @@ -1780,17 +1780,15 @@ em_folder_tree_new_with_model (EMailBackend *backend, EAlertSink *alert_sink, EMFolderTreeModel *model) { - EMailSession *session; const gchar *data_dir; g_return_val_if_fail (E_IS_MAIL_BACKEND (backend), NULL); g_return_val_if_fail (E_IS_ALERT_SINK (alert_sink), NULL); g_return_val_if_fail (EM_IS_FOLDER_TREE_MODEL (model), NULL); - session = e_mail_backend_get_session (backend); data_dir = e_shell_backend_get_data_dir (E_SHELL_BACKEND (backend)); - e_mail_store_init (session, data_dir); + e_mail_store_init (backend, data_dir); return g_object_new ( EM_TYPE_FOLDER_TREE, diff --git a/mail/em-subscription-editor.c b/mail/em-subscription-editor.c index e2452d70bf..09b74bcb3c 100644 --- a/mail/em-subscription-editor.c +++ b/mail/em-subscription-editor.c @@ -51,7 +51,7 @@ typedef struct _AsyncContext AsyncContext; typedef struct _StoreData StoreData; struct _EMSubscriptionEditorPrivate { - CamelSession *session; + EMailBackend *backend; CamelStore *initial_store; GtkWidget *combo_box; /* not referenced */ @@ -95,7 +95,7 @@ struct _StoreData { enum { PROP_0, - PROP_SESSION, + PROP_BACKEND, PROP_STORE }; @@ -932,13 +932,13 @@ subscription_editor_set_store (EMSubscriptionEditor *editor, } static void -subscription_editor_set_session (EMSubscriptionEditor *editor, - CamelSession *session) +subscription_editor_set_backend (EMSubscriptionEditor *editor, + EMailBackend *backend) { - g_return_if_fail (CAMEL_IS_SESSION (session)); - g_return_if_fail (editor->priv->session == NULL); + g_return_if_fail (E_IS_MAIL_BACKEND (backend)); + g_return_if_fail (editor->priv->backend == NULL); - editor->priv->session = g_object_ref (session); + editor->priv->backend = g_object_ref (backend); } static void @@ -948,8 +948,8 @@ subscription_editor_set_property (GObject *object, GParamSpec *pspec) { switch (property_id) { - case PROP_SESSION: - subscription_editor_set_session ( + case PROP_BACKEND: + subscription_editor_set_backend ( EM_SUBSCRIPTION_EDITOR (object), g_value_get_object (value)); return; @@ -971,10 +971,10 @@ subscription_editor_get_property (GObject *object, GParamSpec *pspec) { switch (property_id) { - case PROP_SESSION: + case PROP_BACKEND: g_value_set_object ( value, - em_subscription_editor_get_session ( + em_subscription_editor_get_backend ( EM_SUBSCRIPTION_EDITOR (object))); return; @@ -996,9 +996,9 @@ subscription_editor_dispose (GObject *object) priv = EM_SUBSCRIPTION_EDITOR_GET_PRIVATE (object); - if (priv->session != NULL) { - g_object_unref (priv->session); - priv->session = NULL; + if (priv->backend != NULL) { + g_object_unref (priv->backend); + priv->backend = NULL; } if (priv->initial_store != NULL) { @@ -1044,14 +1044,17 @@ subscription_editor_constructed (GObject *object) if (editor->priv->initial_store == NULL) { EAccount *account; CamelService *service; - CamelSession *session; - const gchar *uid; + EMailBackend *backend; + EMailSession *session; account = e_get_default_account (); - uid = account->uid; - session = em_subscription_editor_get_session (editor); - service = camel_session_get_service (session, uid); + backend = em_subscription_editor_get_backend (editor); + session = e_mail_backend_get_session (backend); + + service = camel_session_get_service ( + CAMEL_SESSION (session), + account->uid); if (CAMEL_IS_SUBSCRIBABLE (service)) editor->priv->initial_store = g_object_ref (service); @@ -1122,12 +1125,12 @@ em_subscription_editor_class_init (EMSubscriptionEditorClass *class) g_object_class_install_property ( object_class, - PROP_SESSION, + PROP_BACKEND, g_param_spec_object ( - "session", + "backend", NULL, NULL, - CAMEL_TYPE_SESSION, + E_TYPE_MAIL_BACKEND, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); @@ -1343,26 +1346,26 @@ em_subscription_editor_init (EMSubscriptionEditor *editor) GtkWidget * em_subscription_editor_new (GtkWindow *parent, - CamelSession *session, + EMailBackend *backend, CamelStore *initial_store) { g_return_val_if_fail (GTK_IS_WINDOW (parent), NULL); - g_return_val_if_fail (CAMEL_IS_SESSION (session), NULL); + g_return_val_if_fail (E_IS_MAIL_BACKEND (backend), NULL); return g_object_new ( EM_TYPE_SUBSCRIPTION_EDITOR, - "session", session, + "backend", backend, "store", initial_store, "transient-for", parent, NULL); } -CamelSession * -em_subscription_editor_get_session (EMSubscriptionEditor *editor) +EMailBackend * +em_subscription_editor_get_backend (EMSubscriptionEditor *editor) { g_return_val_if_fail (EM_IS_SUBSCRIPTION_EDITOR (editor), NULL); - return editor->priv->session; + return editor->priv->backend; } CamelStore * diff --git a/mail/em-subscription-editor.h b/mail/em-subscription-editor.h index d75347760b..80b371f744 100644 --- a/mail/em-subscription-editor.h +++ b/mail/em-subscription-editor.h @@ -21,6 +21,7 @@ #include <gtk/gtk.h> #include <camel/camel.h> +#include <mail/e-mail-backend.h> /* Standard GObject macros */ #define EM_TYPE_SUBSCRIPTION_EDITOR \ @@ -58,9 +59,9 @@ struct _EMSubscriptionEditorClass { GType em_subscription_editor_get_type (void); GtkWidget * em_subscription_editor_new (GtkWindow *parent, - CamelSession *session, + EMailBackend *backend, CamelStore *initial_store); -CamelSession * em_subscription_editor_get_session +EMailBackend * em_subscription_editor_get_backend (EMSubscriptionEditor *editor); CamelStore * em_subscription_editor_get_store (EMSubscriptionEditor *editor); diff --git a/mail/em-utils.c b/mail/em-utils.c index 4a74a80fc2..67978884d0 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -2316,7 +2316,8 @@ free_account_sort_order_cache (void) } static void -fill_accounts_sort_order_cache (EMailBackend *backend, gboolean force_reload) +fill_accounts_sort_order_cache (EMailBackend *backend, + gboolean force_reload) { GSList *account_uids; @@ -2380,7 +2381,8 @@ emu_get_sort_order_key_file (EMailBackend *backend) } void -em_utils_save_accounts_sort_order (EMailBackend *backend, const GSList *account_uids) +em_utils_save_accounts_sort_order (EMailBackend *backend, + const GSList *account_uids) { gchar *filename; GKeyFile *key_file; @@ -2445,7 +2447,8 @@ em_utils_load_accounts_sort_order (EMailBackend *backend) } guint -em_utils_get_account_sort_order (EMailBackend *backend, const gchar *account_uid) +em_utils_get_account_sort_order (EMailBackend *backend, + const gchar *account_uid) { guint res; diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c index 0e1ac98413..30bbce6579 100644 --- a/mail/mail-folder-cache.c +++ b/mail/mail-folder-cache.c @@ -39,8 +39,8 @@ #include <glib/gstdio.h> #include <libedataserver/e-data-server-util.h> -#include "e-util/e-marshal.h" -#include "e-util/e-util.h" +#include <e-util/e-marshal.h> +#include <e-util/e-util.h> #include "mail-mt.h" #include "mail-folder-cache.h" diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 2c4b3067df..0ff745e413 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -452,7 +452,7 @@ static const gchar *resent_recipients[] = { struct _send_queue_msg { MailMsg base; - EMailSession *session; + EMailBackend *backend; CamelFolder *queue; CamelTransport *transport; @@ -483,6 +483,7 @@ mail_send_message (struct _send_queue_msg *m, GError **error) { EAccount *account = NULL; + EMailSession *session; const CamelInternetAddress *iaddr; CamelAddress *from, *recipients; CamelMessageInfo *info = NULL; @@ -504,11 +505,13 @@ mail_send_message (struct _send_queue_msg *m, camel_medium_set_header (CAMEL_MEDIUM (message), "X-Mailer", x_mailer); - err = g_string_new(""); + err = g_string_new (""); xev = mail_tool_remove_xevolution_headers (message); - tmp = camel_header_raw_find(&xev, "X-Evolution-Account", NULL); - if (tmp) { + session = e_mail_backend_get_session (m->backend); + + tmp = camel_header_raw_find (&xev, "X-Evolution-Account", NULL); + if (tmp != NULL) { gchar *name; name = g_strstrip (g_strdup (tmp)); @@ -522,7 +525,7 @@ mail_send_message (struct _send_queue_msg *m, transport_uid = g_strconcat ( account->uid, "-transport", NULL); service = camel_session_get_service ( - CAMEL_SESSION (m->session), + CAMEL_SESSION (session), transport_uid); g_free (transport_uid); @@ -607,7 +610,7 @@ mail_send_message (struct _send_queue_msg *m, uri = g_strstrip (g_strdup (header->value)); /* FIXME Not passing a GCancellable or GError here. */ folder = e_mail_session_uri_to_folder_sync ( - m->session, uri, 0, NULL, NULL); + session, uri, 0, NULL, NULL); if (folder) { /* FIXME Not passing a GCancellable or GError here. */ camel_folder_append_message_sync ( @@ -647,7 +650,7 @@ mail_send_message (struct _send_queue_msg *m, if (sent_folder_uri) { folder = e_mail_session_uri_to_folder_sync ( - m->session, sent_folder_uri, 0, + session, sent_folder_uri, 0, cancellable, &local_error); if (folder == NULL) { g_string_append_printf ( @@ -714,7 +717,7 @@ mail_send_message (struct _send_queue_msg *m, if (local_error == NULL) { /* Mark the draft message for deletion, if present. */ e_mail_session_handle_draft_headers_sync ( - m->session, message, cancellable, &local_error); + session, message, cancellable, &local_error); if (local_error != NULL) { g_warning ("%s: Failed to handle draft headers: %s", G_STRFUNC, local_error->message); g_clear_error (&local_error); @@ -724,7 +727,7 @@ mail_send_message (struct _send_queue_msg *m, * Source message refers to the message being forwarded * or replied to. */ e_mail_session_handle_source_headers_sync ( - m->session, message, cancellable, &local_error); + session, message, cancellable, &local_error); if (local_error != NULL) { g_warning ("%s: Failed to handle source headers: %s", G_STRFUNC, local_error->message); g_clear_error (&local_error); @@ -766,8 +769,6 @@ exit: camel_header_raw_clear (&xev); g_string_free (err, TRUE); g_object_unref (message); - - return; } /* ** SEND MAIL QUEUE ***************************************************** */ @@ -930,8 +931,8 @@ send_queue_desc (struct _send_queue_msg *m) static void send_queue_free (struct _send_queue_msg *m) { - if (m->session != NULL) - g_object_unref (m->session); + if (m->backend != NULL) + g_object_unref (m->backend); if (m->driver != NULL) g_object_unref (m->driver); if (m->transport != NULL) @@ -950,7 +951,7 @@ static MailMsgInfo send_queue_info = { /* same interface as fetch_mail, just 'cause i'm lazy today * (and we need to run it from the same spot?) */ void -mail_send_queue (EMailSession *session, +mail_send_queue (EMailBackend *backend, CamelFolder *queue, CamelTransport *transport, const gchar *type, @@ -962,10 +963,15 @@ mail_send_queue (EMailSession *session, void (*done)(gpointer data), gpointer data) { + EMailSession *session; struct _send_queue_msg *m; + g_return_if_fail (E_IS_MAIL_BACKEND (backend)); + + session = e_mail_backend_get_session (backend); + m = mail_msg_new (&send_queue_info); - m->session = g_object_ref (session); + m->backend = g_object_ref (backend); m->queue = g_object_ref (queue); m->transport = g_object_ref (transport); if (G_IS_CANCELLABLE (cancellable)) diff --git a/mail/mail-ops.h b/mail/mail-ops.h index 32784be245..4ec64ccf22 100644 --- a/mail/mail-ops.h +++ b/mail/mail-ops.h @@ -63,7 +63,7 @@ void mail_xfer_folder (const gchar *src_uri, const gchar *dest_uri, gboolean rem gpointer data); /* yeah so this is messy, but it does a lot, maybe i can consolidate all user_data's to be the one */ -void mail_send_queue (EMailSession *session, +void mail_send_queue (EMailBackend *backend, CamelFolder *queue, CamelTransport *transport, const gchar *type, diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c index 5fda76d103..33ac977e35 100644 --- a/mail/mail-send-recv.c +++ b/mail/mail-send-recv.c @@ -107,7 +107,7 @@ typedef enum { struct _send_info { send_info_t type; /* 0 = fetch, 1 = send */ - EMailSession *session; + EMailBackend *backend; GCancellable *cancellable; gchar *service_uid; gboolean keep_on_server; @@ -151,8 +151,8 @@ free_folder_info (struct _folder_info *info) static void free_send_info (struct _send_info *info) { - if (info->session) - g_object_unref (info->session); + if (info->backend) + g_object_unref (info->backend); if (info->cancellable) g_object_unref (info->cancellable); g_free (info->service_uid); @@ -425,7 +425,7 @@ get_receive_type (CamelURL *url) static struct _send_data * build_dialog (GtkWindow *parent, - EMailSession *session, + EMailBackend *backend, EAccountList *accounts, CamelFolder *outbox, EAccount *outgoing_account, @@ -552,7 +552,7 @@ build_dialog (GtkWindow *parent, info = g_malloc0 (sizeof (*info)); info->type = type; - info->session = g_object_ref (session); + info->backend = g_object_ref (backend); d(printf("adding source %s\n", source->url)); @@ -802,21 +802,24 @@ receive_done (gpointer data) /* if we've been called to run again - run again */ if (info->type == SEND_SEND && info->state == SEND_ACTIVE && info->again) { + EMailSession *session; CamelFolder *local_outbox; CamelService *service; + session = e_mail_backend_get_session (info->backend); + local_outbox = e_mail_local_get_folder ( E_MAIL_LOCAL_FOLDER_OUTBOX); service = camel_session_get_service ( - CAMEL_SESSION (info->session), + CAMEL_SESSION (session), info->service_uid); g_return_if_fail (CAMEL_IS_TRANSPORT (service)); info->again = 0; mail_send_queue ( - info->session, + info->backend, local_outbox, CAMEL_TRANSPORT (service), E_FILTER_SOURCE_OUTGOING, @@ -875,19 +878,24 @@ receive_get_folder (CamelFilterDriver *d, { struct _send_info *info = data; CamelFolder *folder; + EMailSession *session; struct _folder_info *oldinfo; gpointer oldkey, oldinfoptr; g_mutex_lock (info->data->lock); oldinfo = g_hash_table_lookup (info->data->folders, uri); g_mutex_unlock (info->data->lock); + if (oldinfo) { g_object_ref (oldinfo->folder); return oldinfo->folder; } + + session = e_mail_backend_get_session (info->backend); + /* FIXME Not passing a GCancellable here. */ folder = e_mail_session_uri_to_folder_sync ( - info->session, uri, 0, NULL, error); + session, uri, 0, NULL, error); if (!folder) return NULL; @@ -965,6 +973,7 @@ refresh_folders_exec (struct _refresh_folders_msg *m, GError **error) { CamelFolder *folder; + EMailSession *session; gint i; GError *local_error = NULL; gulong handler_id = 0; @@ -978,9 +987,11 @@ refresh_folders_exec (struct _refresh_folders_msg *m, camel_operation_push_message (m->info->cancellable, _("Updating...")); + session = e_mail_backend_get_session (m->info->backend); + for (i = 0; i < m->folders->len; i++) { folder = e_mail_session_uri_to_folder_sync ( - m->info->session, + session, m->folders->pdata[i], 0, cancellable, &local_error); if (folder) { @@ -1068,14 +1079,16 @@ static void receive_update_got_store (CamelStore *store, struct _send_info *info) { + EMailSession *session; MailFolderCache *folder_cache; - folder_cache = e_mail_session_get_folder_cache (info->session); + session = e_mail_backend_get_session (info->backend); + folder_cache = e_mail_session_get_folder_cache (session); if (store) { mail_folder_cache_note_store ( folder_cache, - CAMEL_SESSION (info->session), + CAMEL_SESSION (session), store, info->cancellable, receive_update_got_folderinfo, info); } else { @@ -1085,11 +1098,12 @@ receive_update_got_store (CamelStore *store, static GtkWidget * send_receive (GtkWindow *parent, - EMailSession *session, + EMailBackend *backend, gboolean allow_send) { CamelFolder *local_outbox; struct _send_data *data; + EMailSession *session; EAccountList *accounts; EAccount *account; GList *scan; @@ -1101,6 +1115,8 @@ send_receive (GtkWindow *parent, return send_recv_dialog; } + session = e_mail_backend_get_session (backend); + if (!camel_session_get_online (CAMEL_SESSION (session))) return send_recv_dialog; @@ -1112,7 +1128,7 @@ send_receive (GtkWindow *parent, local_outbox = e_mail_local_get_folder (E_MAIL_LOCAL_FOLDER_OUTBOX); data = build_dialog ( - parent, session, accounts, + parent, backend, accounts, local_outbox, account, allow_send); for (scan = data->infos; scan != NULL; scan = scan->next) { @@ -1139,7 +1155,7 @@ send_receive (GtkWindow *parent, case SEND_SEND: /* todo, store the folder in info? */ mail_send_queue ( - session, local_outbox, + backend, local_outbox, CAMEL_TRANSPORT (service), E_FILTER_SOURCE_OUTGOING, info->cancellable, @@ -1161,21 +1177,21 @@ send_receive (GtkWindow *parent, GtkWidget * mail_send_receive (GtkWindow *parent, - EMailSession *session) + EMailBackend *backend) { - return send_receive (parent, session, TRUE); + return send_receive (parent, backend, TRUE); } GtkWidget * mail_receive (GtkWindow *parent, - EMailSession *session) + EMailBackend *backend) { - return send_receive (parent, session, FALSE); + return send_receive (parent, backend, FALSE); } struct _auto_data { EAccount *account; - EMailSession *session; + EMailBackend *backend; gint period; /* in seconds */ gint timeout_id; }; @@ -1185,10 +1201,13 @@ static GHashTable *auto_active; static gboolean auto_timeout (gpointer data) { + EMailSession *session; struct _auto_data *info = data; - if (camel_session_get_online (CAMEL_SESSION (info->session))) - mail_receive_account (info->session, info->account); + session = e_mail_backend_get_session (info->backend); + + if (camel_session_get_online (CAMEL_SESSION (session))) + mail_receive_account (info->backend, info->account); return TRUE; } @@ -1211,8 +1230,8 @@ auto_account_removed (EAccountList *eal, static void auto_account_finalized (struct _auto_data *info) { - if (info->session != NULL) - g_object_unref (info->session); + if (info->backend != NULL) + g_object_unref (info->backend); if (info->timeout_id) g_source_remove (info->timeout_id); g_free (info); @@ -1243,13 +1262,13 @@ auto_account_commit (struct _auto_data *info) static void auto_account_added (EAccountList *eal, EAccount *ea, - EMailSession *session) + EMailBackend *backend) { struct _auto_data *info; info = g_malloc0 (sizeof (*info)); info->account = ea; - info->session = g_object_ref (session); + info->backend = g_object_ref (backend); g_object_set_data_full ( G_OBJECT (ea), "mail-autoreceive", info, (GDestroyNotify) auto_account_finalized); @@ -1314,7 +1333,6 @@ mail_autoreceive_init (EMailBackend *backend) { EShellBackend *shell_backend; EShellSettings *shell_settings; - EMailSession *session; EAccountList *accounts; EIterator *iter; EShell *shell; @@ -1327,11 +1345,9 @@ mail_autoreceive_init (EMailBackend *backend) accounts = e_get_account_list (); auto_active = g_hash_table_new (g_str_hash, g_str_equal); - session = e_mail_backend_get_session (backend); - g_signal_connect ( accounts, "account-added", - G_CALLBACK (auto_account_added), session); + G_CALLBACK (auto_account_added), backend); g_signal_connect ( accounts, "account-removed", G_CALLBACK (auto_account_removed), NULL); @@ -1344,7 +1360,7 @@ mail_autoreceive_init (EMailBackend *backend) e_iterator_next (iter)) auto_account_added ( accounts, (EAccount *) - e_iterator_get (iter), session); + e_iterator_get (iter), backend); shell_backend = E_SHELL_BACKEND (backend); shell = e_shell_backend_get_shell (shell_backend); @@ -1356,7 +1372,7 @@ mail_autoreceive_init (EMailBackend *backend) /* also flush outbox on start */ if (e_shell_get_online (shell)) - mail_send (session); + mail_send (backend); } g_signal_connect ( @@ -1367,11 +1383,12 @@ mail_autoreceive_init (EMailBackend *backend) /* We setup the download info's in a hashtable, if we later * need to build the gui, we insert them in to add them. */ void -mail_receive_account (EMailSession *session, +mail_receive_account (EMailBackend *backend, EAccount *account) { struct _send_info *info; struct _send_data *data; + EMailSession *session; CamelFolder *local_outbox; CamelService *service; CamelURL *url; @@ -1394,7 +1411,7 @@ mail_receive_account (EMailSession *session, info = g_malloc0 (sizeof (*info)); info->type = type; - info->session = g_object_ref (session); + info->backend = g_object_ref (backend); info->progress_bar = NULL; info->status_label = NULL; info->service_uid = g_strdup (account->uid); @@ -1413,6 +1430,8 @@ mail_receive_account (EMailSession *session, g_hash_table_insert (data->active, account->uid, info); + session = e_mail_backend_get_session (backend); + service = camel_session_get_service ( CAMEL_SESSION (session), account->uid); @@ -1434,7 +1453,7 @@ mail_receive_account (EMailSession *session, local_outbox = e_mail_local_get_folder ( E_MAIL_LOCAL_FOLDER_OUTBOX); mail_send_queue ( - info->session, + info->backend, local_outbox, CAMEL_TRANSPORT (service), E_FILTER_SOURCE_OUTGOING, @@ -1452,10 +1471,11 @@ mail_receive_account (EMailSession *session, } void -mail_send (EMailSession *session) +mail_send (EMailBackend *backend) { CamelFolder *local_outbox; CamelService *service; + EMailSession *session; EAccount *account; CamelURL *url; struct _send_info *info; @@ -1490,7 +1510,7 @@ mail_send (EMailSession *session) info = g_malloc0 (sizeof (*info)); info->type = SEND_SEND; - info->session = g_object_ref (session); + info->backend = g_object_ref (backend); info->progress_bar = NULL; info->status_label = NULL; info->service_uid = g_strdup (transport_uid); @@ -1508,6 +1528,8 @@ mail_send (EMailSession *session) /* todo, store the folder in info? */ local_outbox = e_mail_local_get_folder (E_MAIL_LOCAL_FOLDER_OUTBOX); + session = e_mail_backend_get_session (backend); + service = camel_session_get_service ( CAMEL_SESSION (session), transport_uid); @@ -1516,7 +1538,7 @@ mail_send (EMailSession *session) g_return_if_fail (CAMEL_IS_TRANSPORT (service)); mail_send_queue ( - session, local_outbox, + backend, local_outbox, CAMEL_TRANSPORT (service), E_FILTER_SOURCE_OUTGOING, info->cancellable, diff --git a/mail/mail-send-recv.h b/mail/mail-send-recv.h index 5da6599712..f702b74d7a 100644 --- a/mail/mail-send-recv.h +++ b/mail/mail-send-recv.h @@ -32,16 +32,16 @@ G_BEGIN_DECLS /* send/receive all uri's */ GtkWidget * mail_send_receive (GtkWindow *parent, - EMailSession *session); + EMailBackend *backend); GtkWidget * mail_receive (GtkWindow *parent, - EMailSession *session); + EMailBackend *backend); /* receive a single account */ -void mail_receive_account (EMailSession *session, +void mail_receive_account (EMailBackend *backend, EAccount *account); -void mail_send (EMailSession *session); +void mail_send (EMailBackend *backend); /* setup auto receive stuff */ void mail_autoreceive_init (EMailBackend *backend); diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c index 78d0863e0c..c1e451d04c 100644 --- a/mail/mail-vfolder.c +++ b/mail/mail-vfolder.c @@ -1161,7 +1161,7 @@ vfolder_load_storage (EMailBackend *backend) G_CALLBACK (context_rule_removed), context); /* load store to mail component */ - e_mail_store_add (session, vfolder_store); + e_mail_store_add (backend, vfolder_store); /* and setup the rules we have */ rule = NULL; diff --git a/mail/message-list.c b/mail/message-list.c index d98f860f8c..602bdfa4dd 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -3332,7 +3332,7 @@ build_tree (MessageList *ml, #endif if (!saveuid && ml->cursor_uid && g_hash_table_lookup (ml->uid_nodemap, ml->cursor_uid)) { /* this makes sure a visible node is selected, like when - collapsing all nodes and a children had been selected + * collapsing all nodes and a children had been selected */ saveuid = g_strdup (ml->cursor_uid); } |