aboutsummaryrefslogtreecommitdiffstats
path: root/mail/e-mail-migrate.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-10-07 11:38:52 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-10-13 01:58:59 +0800
commita06e4484b8df804124b5bcf88d94dec5acfba270 (patch)
tree4fa42793d7dc461f2b3767296d76592182c48222 /mail/e-mail-migrate.c
parent5e0758bb6934a7859b1d8a247c8fb21c156772cf (diff)
downloadgsoc2013-evolution-a06e4484b8df804124b5bcf88d94dec5acfba270.tar.gz
gsoc2013-evolution-a06e4484b8df804124b5bcf88d94dec5acfba270.tar.zst
gsoc2013-evolution-a06e4484b8df804124b5bcf88d94dec5acfba270.zip
Give MailSession a permanent home.
Global variables in shared libraries are a bad idea. EMailBackend now owns the MailSession instance, which is actually now EMailSession. Move the blocking utility functions in mail-tools.c to e-mail-session.c and add asynchronous variants. Same approach as Camel. Replace EMailReader.get_shell_backend() with EMailReader.get_backend(), which returns an EMailBackend. Easier access to the EMailSession.
Diffstat (limited to 'mail/e-mail-migrate.c')
-rw-r--r--mail/e-mail-migrate.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/mail/e-mail-migrate.c b/mail/e-mail-migrate.c
index f5481bc68a..ff3b70476c 100644
--- a/mail/e-mail-migrate.c
+++ b/mail/e-mail-migrate.c
@@ -60,6 +60,7 @@
#include "shell/e-shell-migrate.h"
#include "e-mail-store.h"
+#include "e-mail-backend.h"
#include "mail-config.h"
#include "em-utils.h"
@@ -633,6 +634,8 @@ 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;
@@ -642,6 +645,9 @@ migrate_to_db (EShellBackend *shell_backend)
if (!(accounts = e_get_account_list ()))
return;
+ mail_backend = E_MAIL_BACKEND (shell_backend);
+ mail_session = e_mail_backend_get_session (mail_backend);
+
iter = e_list_get_iterator ((EList *) accounts);
len = e_list_length ((EList *) accounts);
@@ -694,7 +700,8 @@ migrate_to_db (EShellBackend *shell_backend)
&& service->url[0]
&& strncmp(service->url, "mbox:", 5) != 0) {
- e_mail_store_add_by_uri (service->url, name);
+ e_mail_store_add_by_uri (
+ mail_session, service->url, name);
store = (CamelStore *) camel_session_get_service (CAMEL_SESSION (session), service->url, CAMEL_PROVIDER_STORE, NULL);
info = camel_store_get_folder_info_sync (