aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-rw-r--r--mail/e-mail-backend.c16
-rw-r--r--mail/em-utils.c2
-rw-r--r--mail/mail-config.c2
-rw-r--r--mail/mail-session.c10
4 files changed, 18 insertions, 12 deletions
diff --git a/mail/e-mail-backend.c b/mail/e-mail-backend.c
index b2e22e397d..14a7d22ad3 100644
--- a/mail/e-mail-backend.c
+++ b/mail/e-mail-backend.c
@@ -368,6 +368,17 @@ mail_backend_folder_changed_cb (MailFolderCache *folder_cache,
(EEventTarget *) target);
}
+static gboolean
+mail_backend_idle_cb (EShellBackend *shell_backend)
+{
+ const gchar *data_dir;
+
+ data_dir = e_shell_backend_get_data_dir (shell_backend);
+ e_mail_store_init (data_dir);
+
+ return FALSE;
+}
+
static void
mail_backend_constructed (GObject *object)
{
@@ -422,8 +433,9 @@ mail_backend_constructed (GObject *object)
mail_config_init ();
mail_msg_init ();
- data_dir = e_shell_backend_get_data_dir (shell_backend);
- e_mail_store_init (data_dir);
+ /* Defer initializing CamelStores until after the main loop
+ * has started, so migration has a chance to run first. */
+ g_idle_add ((GSourceFunc) mail_backend_idle_cb, shell_backend);
}
static void
diff --git a/mail/em-utils.c b/mail/em-utils.c
index e182e61364..80699ec7a2 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -2342,7 +2342,7 @@ emu_restore_folder_tree_state (EMFolderTree *folder_tree)
config_dir = e_shell_backend_get_config_dir (backend);
g_return_if_fail (config_dir != NULL);
- filename = g_build_filename (config_dir, "state", NULL);
+ filename = g_build_filename (config_dir, "state.ini", NULL);
key_file = g_key_file_new ();
g_key_file_load_from_file (key_file, filename, 0, &error);
diff --git a/mail/mail-config.c b/mail/mail-config.c
index 8c76353478..8bbd9fc119 100644
--- a/mail/mail-config.c
+++ b/mail/mail-config.c
@@ -535,7 +535,7 @@ mail_config_folder_to_cachename (CamelFolder *folder, const gchar *prefix)
config_dir = mail_session_get_config_dir ();
url = mail_config_folder_to_safe_url (folder);
basename = g_strdup_printf ("%s%s", prefix, url);
- filename = g_build_filename (config_dir, basename, NULL);
+ filename = g_build_filename (config_dir, "folders", basename, NULL);
g_free (basename);
g_free (url);
diff --git a/mail/mail-session.c b/mail/mail-session.c
index 1ccb87cbca..039640109a 100644
--- a/mail/mail-session.c
+++ b/mail/mail-session.c
@@ -1007,15 +1007,9 @@ mail_session_get_data_dir (void)
const gchar *
mail_session_get_config_dir (void)
{
- if (G_UNLIKELY (mail_config_dir == NULL)) {
+ if (G_UNLIKELY (mail_config_dir == NULL))
mail_config_dir = g_build_filename (
- mail_session_get_data_dir (), "config", NULL);
-
- if (g_mkdir_with_parents (mail_config_dir, 0777) != 0)
- g_critical (
- "Cannot create directory %s: %s",
- mail_config_dir, g_strerror (errno));
- }
+ e_get_user_config_dir (), "mail", NULL);
return mail_config_dir;
}