aboutsummaryrefslogtreecommitdiffstats
path: root/mail/e-mail-migrate.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-01-08 03:52:07 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-01-08 04:25:42 +0800
commit41c66f2d87932113de4cfb2a19a13daf67681297 (patch)
tree0928b1d4524cfb987d3eaa57b44228fac070a719 /mail/e-mail-migrate.c
parente962715a181517a352a3987a934097050505b343 (diff)
downloadgsoc2013-evolution-41c66f2d87932113de4cfb2a19a13daf67681297.tar
gsoc2013-evolution-41c66f2d87932113de4cfb2a19a13daf67681297.tar.gz
gsoc2013-evolution-41c66f2d87932113de4cfb2a19a13daf67681297.tar.bz2
gsoc2013-evolution-41c66f2d87932113de4cfb2a19a13daf67681297.tar.lz
gsoc2013-evolution-41c66f2d87932113de4cfb2a19a13daf67681297.tar.xz
gsoc2013-evolution-41c66f2d87932113de4cfb2a19a13daf67681297.tar.zst
gsoc2013-evolution-41c66f2d87932113de4cfb2a19a13daf67681297.zip
Avoid idle callbacks in EMailBackend initialization.
If the migration phase has to show a dialog the idle callback for intializing mail stores will run too soon. Instead, hook it onto the EShellBackend start() method. Migration code can initialize mail stores early if it needs to.
Diffstat (limited to 'mail/e-mail-migrate.c')
-rw-r--r--mail/e-mail-migrate.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/mail/e-mail-migrate.c b/mail/e-mail-migrate.c
index 91a5e6fc43..ef12be0915 100644
--- a/mail/e-mail-migrate.c
+++ b/mail/e-mail-migrate.c
@@ -646,11 +646,14 @@ migrate_to_db (EShellBackend *shell_backend)
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);
iter = e_list_get_iterator ((EList *) accounts);
len = e_list_length ((EList *) accounts);
- data_dir = e_shell_backend_get_data_dir (shell_backend);
session = (EMMigrateSession *) em_migrate_session_new (data_dir);
camel_session_set_online ((CamelSession *) session, FALSE);
em_migrate_setup_progress_dialog (
@@ -965,10 +968,14 @@ create_mbox_account (EShellBackend *shell_backend, EMMigrateSession *session)
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);
+
account = e_account_new ();
account->enabled = TRUE;
- data_dir = e_shell_backend_get_data_dir (shell_backend);
url = camel_url_new ("mbox:", NULL);
temp = g_build_filename (data_dir, "local_mbox", NULL);
camel_url_set_path (url, temp);