aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-02-11 19:58:29 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-06-30 00:41:32 +0800
commit2e83026eaa4c190a0e5dcb6dd65cbfc926191444 (patch)
tree62b5aeff23143a22b315e5cd5cd35d3de0153651
parent85542a15b4562080314f16e54a061c198e2bb81d (diff)
downloadgsoc2013-evolution-2e83026eaa4c190a0e5dcb6dd65cbfc926191444.tar.gz
gsoc2013-evolution-2e83026eaa4c190a0e5dcb6dd65cbfc926191444.tar.zst
gsoc2013-evolution-2e83026eaa4c190a0e5dcb6dd65cbfc926191444.zip
Bug #637727 - Sent/Draft folder not set in startup-wizard account
-rw-r--r--mail/e-mail-local.c11
-rw-r--r--modules/startup-wizard/evolution-startup-wizard.c5
2 files changed, 14 insertions, 2 deletions
diff --git a/mail/e-mail-local.c b/mail/e-mail-local.c
index c5efcc06b0..2779c0e054 100644
--- a/mail/e-mail-local.c
+++ b/mail/e-mail-local.c
@@ -41,22 +41,26 @@ static struct {
};
static CamelStore *local_store;
+static gboolean mail_local_initialized = FALSE;
void
e_mail_local_init (EMailSession *session,
const gchar *data_dir)
{
- static gboolean initialized = FALSE;
CamelService *service;
CamelURL *url;
gchar *temp;
gint ii;
GError *local_error = NULL;
- g_return_if_fail (!initialized);
+ if (mail_local_initialized)
+ return;
+
g_return_if_fail (E_IS_MAIL_SESSION (session));
g_return_if_fail (data_dir != NULL);
+ mail_local_initialized = TRUE;
+
url = camel_url_new ("maildir:", NULL);
temp = g_build_filename (data_dir, "local", NULL);
camel_url_set_path (url, temp);
@@ -113,6 +117,7 @@ fail:
CamelFolder *
e_mail_local_get_folder (EMailLocalFolder type)
{
+ g_return_val_if_fail (mail_local_initialized, NULL);
g_return_val_if_fail (CHECK_LOCAL_FOLDER_TYPE (type), NULL);
return default_local_folders[type].folder;
@@ -121,6 +126,7 @@ e_mail_local_get_folder (EMailLocalFolder type)
const gchar *
e_mail_local_get_folder_uri (EMailLocalFolder type)
{
+ g_return_val_if_fail (mail_local_initialized, NULL);
g_return_val_if_fail (CHECK_LOCAL_FOLDER_TYPE (type), NULL);
return default_local_folders[type].folder_uri;
@@ -129,6 +135,7 @@ e_mail_local_get_folder_uri (EMailLocalFolder type)
CamelStore *
e_mail_local_get_store (void)
{
+ g_return_val_if_fail (mail_local_initialized, NULL);
g_return_val_if_fail (CAMEL_IS_STORE (local_store), NULL);
return local_store;
diff --git a/modules/startup-wizard/evolution-startup-wizard.c b/modules/startup-wizard/evolution-startup-wizard.c
index 928ff277cb..2bbaa5675e 100644
--- a/modules/startup-wizard/evolution-startup-wizard.c
+++ b/modules/startup-wizard/evolution-startup-wizard.c
@@ -26,6 +26,7 @@
#include <e-util/e-import.h>
#include <mail/e-mail-backend.h>
+#include <mail/e-mail-local.h>
#include <mail/em-account-editor.h>
#include <capplet/settings/mail-capplet-shell.h>
#include <calendar/gui/calendar-config.h>
@@ -434,12 +435,16 @@ startup_wizard_new_assistant (EStartupWizard *extension)
EConfigItem *config_item;
GtkWidget *widget;
GSList *items = NULL;
+ const gchar *data_dir;
shell = startup_wizard_get_shell (extension);
shell_backend = e_shell_get_backend_by_name (shell, "mail");
backend = E_MAIL_BACKEND (shell_backend);
session = e_mail_backend_get_session (backend);
+ data_dir = e_shell_backend_get_data_dir (shell_backend);
+
+ e_mail_local_init (session, data_dir);
emae = em_account_editor_new (
NULL, EMAE_ASSISTANT, session,