aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@gnome-db.org>2011-10-28 17:38:03 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-10-28 17:38:03 +0800
commitb3b35231e2ce675202ef9f1a7ccefdc3ab0e0e89 (patch)
tree7190b4353c533028b4a0c27d241d96e883a280ad
parent9744056c5e69227abdcdd55c4bffb674b29bd765 (diff)
parent8f5493140c4da6e81e2c14e77833bfbb56c619f8 (diff)
downloadgsoc2013-evolution-b3b35231e2ce675202ef9f1a7ccefdc3ab0e0e89.tar
gsoc2013-evolution-b3b35231e2ce675202ef9f1a7ccefdc3ab0e0e89.tar.gz
gsoc2013-evolution-b3b35231e2ce675202ef9f1a7ccefdc3ab0e0e89.tar.bz2
gsoc2013-evolution-b3b35231e2ce675202ef9f1a7ccefdc3ab0e0e89.tar.lz
gsoc2013-evolution-b3b35231e2ce675202ef9f1a7ccefdc3ab0e0e89.tar.xz
gsoc2013-evolution-b3b35231e2ce675202ef9f1a7ccefdc3ab0e0e89.tar.zst
gsoc2013-evolution-b3b35231e2ce675202ef9f1a7ccefdc3ab0e0e89.zip
Merge branch 'master' into wip/gsettings
-rw-r--r--capplet/anjal-settings-main.c5
-rw-r--r--capplet/settings/mail-capplet-shell.c2
-rw-r--r--capplet/settings/mail-guess-servers.c4
-rw-r--r--mail/e-mail-backend.c11
-rw-r--r--mail/e-mail-migrate.c12
-rw-r--r--mail/e-mail-store.c57
-rw-r--r--mail/e-mail-store.h14
-rw-r--r--mail/em-account-editor.c4
-rw-r--r--mail/em-folder-tree-model.c4
-rw-r--r--mail/em-folder-tree.c4
-rw-r--r--mail/mail-vfolder.c2
-rw-r--r--modules/mail/e-mail-shell-backend.c7
-rw-r--r--modules/mail/e-mail-shell-view-actions.c8
-rw-r--r--modules/mail/em-account-prefs.c14
-rw-r--r--plugins/pst-import/pst-importer.c67
-rw-r--r--shell/main.c4
16 files changed, 136 insertions, 83 deletions
diff --git a/capplet/anjal-settings-main.c b/capplet/anjal-settings-main.c
index 91e36904c7..7efddcffbf 100644
--- a/capplet/anjal-settings-main.c
+++ b/capplet/anjal-settings-main.c
@@ -167,11 +167,6 @@ main (gint argc,
if (!gtk_init_with_args (&argc, &argv, NULL, entries, NULL, &error))
g_error ("%s", error->message);
- #if !GLIB_CHECK_VERSION(2,31,0)
- if (!g_thread_get_initialized ())
- g_thread_init (NULL);
- #endif
-
e_passwords_init ();
categories_icon_theme_hack ();
diff --git a/capplet/settings/mail-capplet-shell.c b/capplet/settings/mail-capplet-shell.c
index 6567da02ac..2bf464c7c0 100644
--- a/capplet/settings/mail-capplet-shell.c
+++ b/capplet/settings/mail-capplet-shell.c
@@ -278,7 +278,7 @@ mail_capplet_shell_construct (MailCappletShell *shell,
mail_config_init (session);
mail_msg_init ();
custom_dir = g_build_filename (e_get_user_data_dir (), "mail", NULL);
- e_mail_store_init (shell->priv->backend, custom_dir);
+ e_mail_store_init (session, custom_dir);
g_free (custom_dir);
if (just_druid) {
diff --git a/capplet/settings/mail-guess-servers.c b/capplet/settings/mail-guess-servers.c
index 0b15271a88..8ab9670e8c 100644
--- a/capplet/settings/mail-guess-servers.c
+++ b/capplet/settings/mail-guess-servers.c
@@ -343,9 +343,7 @@ main (gint argc,
gchar **argv)
{
EmailProvider *provider;
- #if !GLIB_CHECK_VERSION(2,31,0)
- g_thread_init (NULL);
- #endif
+
g_type_init ();
provider = g_new0 (EmailProvider, 1);
diff --git a/mail/e-mail-backend.c b/mail/e-mail-backend.c
index be2f94eeb9..aedbdd2626 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 (
- backend, (GFunc) mail_store_prepare_for_offline_cb, activity);
+ session, (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 (
- backend, (GFunc) mail_store_prepare_for_online_cb, activity);
+ session, (GFunc) mail_store_prepare_for_online_cb, activity);
}
/* Helper for mail_backend_prepare_for_quit_cb() */
@@ -272,6 +272,7 @@ mail_backend_prepare_for_quit_cb (EShell *shell,
EMailBackend *backend)
{
EAccountList *account_list;
+ EMailSession *session;
gboolean delete_junk;
gboolean empty_trash;
@@ -280,6 +281,8 @@ 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);
@@ -295,13 +298,13 @@ mail_backend_prepare_for_quit_cb (EShell *shell,
if (delete_junk)
e_mail_store_foreach (
- backend, (GFunc) mail_backend_delete_junk, backend);
+ session, (GFunc) mail_backend_delete_junk, backend);
sync_data.activity = activity;
sync_data.empty_trash = empty_trash;
e_mail_store_foreach (
- backend, (GFunc) mail_backend_final_sync, &sync_data);
+ session, (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
diff --git a/mail/e-mail-migrate.c b/mail/e-mail-migrate.c
index b11e3c4ae1..59605e24a4 100644
--- a/mail/e-mail-migrate.c
+++ b/mail/e-mail-migrate.c
@@ -701,6 +701,7 @@ 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,10 +714,11 @@ 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_backend, data_dir);
+ e_mail_store_init (mail_session, data_dir);
iter = e_list_get_iterator ((EList *) accounts);
len = e_list_length ((EList *) accounts);
@@ -773,7 +775,7 @@ migrate_to_db (EShellBackend *shell_backend)
&& strncmp (service->url, "mbox:", 5) != 0) {
store = e_mail_store_add_by_account (
- mail_backend, account);
+ mail_session, account);
info = camel_store_get_folder_info_sync (
store, NULL,
@@ -1016,6 +1018,7 @@ create_mbox_account (EShellBackend *shell_backend,
EMMigrateSession *session)
{
EMailBackend *mail_backend;
+ EMailSession *mail_session;
CamelStore *store;
CamelURL *url;
EAccountList *accounts;
@@ -1024,10 +1027,11 @@ 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_backend, data_dir);
+ e_mail_store_init (mail_session, data_dir);
account = e_account_new ();
account->enabled = TRUE;
@@ -1061,7 +1065,7 @@ create_mbox_account (EShellBackend *shell_backend,
}
e_account_list_add (accounts, account);
- store = e_mail_store_add_by_account (mail_backend, account);
+ store = e_mail_store_add_by_account (mail_session, account);
folder_uri = e_mail_folder_uri_build (store, "Sent");
e_account_set_string (
diff --git a/mail/e-mail-store.c b/mail/e-mail-store.c
index 07dcab8c5e..c995f42498 100644
--- a/mail/e-mail-store.c
+++ b/mail/e-mail-store.c
@@ -182,20 +182,17 @@ special_mail_store_is_enabled (CamelStore *store)
}
static void
-mail_store_add (EMailBackend *backend,
+mail_store_add (EMailSession *session,
CamelStore *store,
AddStoreCallback callback)
{
- EMailSession *session;
EMFolderTreeModel *default_model;
MailFolderCache *folder_cache;
StoreInfo *store_info;
g_return_if_fail (store_table != NULL);
- 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);
@@ -230,23 +227,20 @@ mail_store_add_local_done_cb (MailFolderCache *folder_cache,
}
static void
-mail_store_load_accounts (EMailBackend *backend,
+mail_store_load_accounts (EMailSession *session,
const gchar *data_dir)
{
CamelStore *local_store;
- EMailSession *session;
EAccountList *account_list;
EIterator *iter;
- 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 (
- backend, local_store, (AddStoreCallback)
+ session, local_store, (AddStoreCallback)
mail_store_add_local_done_cb);
/* Add mail accounts.. */
@@ -262,19 +256,19 @@ mail_store_load_accounts (EMailBackend *backend,
if (!account->enabled)
continue;
- e_mail_store_add_by_account (backend, account);
+ e_mail_store_add_by_account (session, account);
}
g_object_unref (iter);
}
void
-e_mail_store_init (EMailBackend *backend,
+e_mail_store_init (EMailSession *session,
const gchar *data_dir)
{
static gboolean initialized = FALSE;
- g_return_if_fail (E_IS_MAIL_BACKEND (backend));
+ g_return_if_fail (E_IS_MAIL_SESSION (session));
/* This function is idempotent because mail
* migration code may need to call it early. */
@@ -288,26 +282,25 @@ e_mail_store_init (EMailBackend *backend,
(GDestroyNotify) NULL,
(GDestroyNotify) store_table_free);
- mail_store_load_accounts (backend, data_dir);
+ mail_store_load_accounts (session, data_dir);
initialized = TRUE;
}
void
-e_mail_store_add (EMailBackend *backend,
+e_mail_store_add (EMailSession *session,
CamelStore *store)
{
- g_return_if_fail (E_IS_MAIL_BACKEND (backend));
+ g_return_if_fail (E_IS_MAIL_SESSION (session));
g_return_if_fail (CAMEL_IS_STORE (store));
- mail_store_add (backend, store, NULL);
+ mail_store_add (session, store, NULL);
}
CamelStore *
-e_mail_store_add_by_account (EMailBackend *backend,
+e_mail_store_add_by_account (EMailSession *session,
EAccount *account)
{
- EMailSession *session;
CamelService *service = NULL;
CamelProvider *provider;
CamelURL *url;
@@ -316,11 +309,9 @@ e_mail_store_add_by_account (EMailBackend *backend,
gboolean service_belongs_in_tree_model;
GError *error = NULL;
- g_return_val_if_fail (E_IS_MAIL_BACKEND (backend), NULL);
+ g_return_val_if_fail (E_IS_MAIL_SESSION (session), 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 == NULL) ||
@@ -365,7 +356,7 @@ e_mail_store_add_by_account (EMailBackend *backend,
!service_is_local_delivery;
if (service_belongs_in_tree_model && store_table != NULL)
- e_mail_store_add (backend, CAMEL_STORE (service));
+ e_mail_store_add (session, CAMEL_STORE (service));
handle_transport:
@@ -426,19 +417,16 @@ fail:
}
void
-e_mail_store_remove (EMailBackend *backend,
+e_mail_store_remove (EMailSession *session,
CamelStore *store)
{
- EMailSession *session;
MailFolderCache *folder_cache;
EMFolderTreeModel *default_model;
- g_return_if_fail (E_IS_MAIL_BACKEND (backend));
+ g_return_if_fail (E_IS_MAIL_SESSION (session));
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
@@ -463,19 +451,17 @@ e_mail_store_remove (EMailBackend *backend,
}
void
-e_mail_store_remove_by_account (EMailBackend *backend,
+e_mail_store_remove_by_account (EMailSession *session,
EAccount *account)
{
- EMailSession *session;
CamelService *service;
CamelProvider *provider;
const gchar *uid;
- g_return_if_fail (E_IS_MAIL_BACKEND (backend));
+ g_return_if_fail (E_IS_MAIL_SESSION (session));
g_return_if_fail (E_IS_ACCOUNT (account));
uid = account->uid;
- session = e_mail_backend_get_session (backend);
service = camel_session_get_service (CAMEL_SESSION (session), uid);
g_return_if_fail (CAMEL_IS_STORE (service));
@@ -486,25 +472,22 @@ e_mail_store_remove_by_account (EMailBackend *backend,
if (!(provider->flags & CAMEL_PROVIDER_IS_STORAGE) || store_table == NULL)
return;
- e_mail_store_remove (backend, CAMEL_STORE (service));
+ e_mail_store_remove (session, CAMEL_STORE (service));
}
void
-e_mail_store_foreach (EMailBackend *backend,
+e_mail_store_foreach (EMailSession *session,
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_BACKEND (backend));
+ g_return_if_fail (E_IS_MAIL_SESSION (session));
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 2c676d4fc4..5dca416e09 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-backend.h>
+#include <mail/e-mail-session.h>
#include <libedataserver/e-account.h>
G_BEGIN_DECLS
-void e_mail_store_init (EMailBackend *backend,
+void e_mail_store_init (EMailSession *session,
const gchar *data_dir);
-void e_mail_store_add (EMailBackend *backend,
+void e_mail_store_add (EMailSession *session,
CamelStore *store);
-CamelStore * e_mail_store_add_by_account (EMailBackend *backend,
+CamelStore * e_mail_store_add_by_account (EMailSession *session,
EAccount *account);
-void e_mail_store_remove (EMailBackend *backend,
+void e_mail_store_remove (EMailSession *session,
CamelStore *store);
-void e_mail_store_remove_by_account (EMailBackend *backend,
+void e_mail_store_remove_by_account (EMailSession *session,
EAccount *account);
-void e_mail_store_foreach (EMailBackend *backend,
+void e_mail_store_foreach (EMailSession *session,
GFunc func,
gpointer user_data);
diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c
index 49a6798415..70a392a327 100644
--- a/mail/em-account-editor.c
+++ b/mail/em-account-editor.c
@@ -4108,9 +4108,11 @@ 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);
- e_mail_store_add_by_account (backend, account);
+ session = e_mail_backend_get_session (backend);
+ e_mail_store_add_by_account (session, account);
}
}
diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c
index 0d305799fb..e63d36261f 100644
--- a/mail/em-folder-tree-model.c
+++ b/mail/em-folder-tree-model.c
@@ -288,10 +288,12 @@ 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 (backend, account);
+ e_mail_store_add_by_account (session, account);
}
static void
diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c
index 973051324f..79e9a04288 100644
--- a/mail/em-folder-tree.c
+++ b/mail/em-folder-tree.c
@@ -1785,15 +1785,17 @@ 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 (backend, data_dir);
+ e_mail_store_init (session, data_dir);
return g_object_new (
EM_TYPE_FOLDER_TREE,
diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c
index 2d491e1bae..5fe6c09d04 100644
--- a/mail/mail-vfolder.c
+++ b/mail/mail-vfolder.c
@@ -1158,7 +1158,7 @@ vfolder_load_storage (EMailBackend *backend)
G_CALLBACK (context_rule_removed), context);
/* load store to mail component */
- e_mail_store_add (backend, vfolder_store);
+ e_mail_store_add (session, vfolder_store);
/* and setup the rules we have */
rule = NULL;
diff --git a/modules/mail/e-mail-shell-backend.c b/modules/mail/e-mail-shell-backend.c
index 9067437a71..ce563124c6 100644
--- a/modules/mail/e-mail-shell-backend.c
+++ b/modules/mail/e-mail-shell-backend.c
@@ -252,8 +252,8 @@ mail_shell_backend_mail_sync (EMailShellBackend *mail_shell_backend)
session = e_mail_backend_get_session (backend);
e_mail_store_foreach (
- E_MAIL_BACKEND (mail_shell_backend),
- (GFunc) mail_shell_backend_sync_store_cb,
+ session, (GFunc)
+ mail_shell_backend_sync_store_cb,
mail_shell_backend);
exit:
@@ -457,9 +457,10 @@ mail_shell_backend_start (EShellBackend *shell_backend)
shell_settings = e_shell_get_shell_settings (shell);
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_store_init (backend, data_dir);
+ e_mail_store_init (session, data_dir);
enable_search_folders = e_shell_settings_get_boolean (
shell_settings, "mail-enable-search-folders");
diff --git a/modules/mail/e-mail-shell-view-actions.c b/modules/mail/e-mail-shell-view-actions.c
index 2595b12d45..08cdfd81e4 100644
--- a/modules/mail/e-mail-shell-view-actions.c
+++ b/modules/mail/e-mail-shell-view-actions.c
@@ -85,6 +85,7 @@ action_mail_account_disable_cb (GtkAction *action,
EShellBackend *shell_backend;
EShellView *shell_view;
EMailBackend *backend;
+ EMailSession *session;
EMFolderTree *folder_tree;
CamelService *service;
CamelStore *store;
@@ -98,6 +99,7 @@ action_mail_account_disable_cb (GtkAction *action,
shell_backend = e_shell_view_get_shell_backend (shell_view);
backend = E_MAIL_BACKEND (shell_backend);
+ session = e_mail_backend_get_session (backend);
folder_tree = e_mail_shell_sidebar_get_folder_tree (mail_shell_sidebar);
store = em_folder_tree_get_selected_store (folder_tree);
@@ -115,7 +117,7 @@ action_mail_account_disable_cb (GtkAction *action,
account->enabled = !account->enabled;
e_account_list_change (account_list, account);
- e_mail_store_remove_by_account (backend, account);
+ e_mail_store_remove_by_account (session, account);
if (account->parent_uid != NULL)
e_account_list_remove (account_list, account);
@@ -225,15 +227,17 @@ action_mail_download_cb (GtkAction *action,
EMailView *mail_view;
EMailReader *reader;
EMailBackend *backend;
+ EMailSession *session;
mail_shell_content = mail_shell_view->priv->mail_shell_content;
mail_view = e_mail_shell_content_get_mail_view (mail_shell_content);
reader = E_MAIL_READER (mail_view);
backend = e_mail_reader_get_backend (reader);
+ session = e_mail_backend_get_session (backend);
e_mail_store_foreach (
- backend, (GFunc) action_mail_download_foreach_cb, reader);
+ session, (GFunc) action_mail_download_foreach_cb, reader);
}
static void
diff --git a/modules/mail/em-account-prefs.c b/modules/mail/em-account-prefs.c
index f4a0a740d5..4bd6c1c968 100644
--- a/modules/mail/em-account-prefs.c
+++ b/modules/mail/em-account-prefs.c
@@ -108,7 +108,8 @@ account_prefs_enable_account_cb (EAccountTreeView *tree_view,
g_return_if_fail (account != NULL);
- e_mail_store_add_by_account (prefs->priv->backend, account);
+ session = e_mail_backend_get_session (prefs->priv->backend);
+ e_mail_store_add_by_account (session, account);
}
static void
@@ -118,6 +119,7 @@ account_prefs_disable_account_cb (EAccountTreeView *tree_view,
EAccountList *account_list;
EMailSession *session;
EAccount *account;
+ EMailSession *session;
gpointer parent;
gint response;
@@ -129,11 +131,13 @@ account_prefs_disable_account_cb (EAccountTreeView *tree_view,
g_return_if_fail (account != NULL);
+ session = e_mail_backend_get_session (prefs->priv->backend);
+
account_list = e_account_tree_view_get_account_list (tree_view);
g_return_if_fail (account_list != NULL);
if (!e_account_list_account_has_proxies (account_list, account)) {
- e_mail_store_remove_by_account (prefs->priv->backend, account);
+ e_mail_store_remove_by_account (session, account);
return;
}
@@ -150,7 +154,7 @@ account_prefs_disable_account_cb (EAccountTreeView *tree_view,
e_account_list_remove_account_proxies (account_list, account);
- e_mail_store_remove_by_account (prefs->priv->backend, account);
+ e_mail_store_remove_by_account (session, account);
}
static void
@@ -324,11 +328,13 @@ account_prefs_delete_account (EAccountManager *manager)
EAccountList *account_list;
EMailSession *session;
EAccount *account;
+ EMailSession *session;
gboolean has_proxies;
gpointer parent;
gint response;
priv = EM_ACCOUNT_PREFS (manager)->priv;
+ session = e_mail_backend_get_session (priv->backend);
account_list = e_account_manager_get_account_list (manager);
tree_view = e_account_manager_get_tree_view (manager);
@@ -357,7 +363,7 @@ account_prefs_delete_account (EAccountManager *manager)
/* Remove the account from the folder tree. */
if (account->enabled)
- e_mail_store_remove_by_account (priv->backend, account);
+ e_mail_store_remove_by_account (session, account);
/* Remove all the proxies the account has created. */
if (has_proxies)
diff --git a/plugins/pst-import/pst-importer.c b/plugins/pst-import/pst-importer.c
index 89e45e6785..7ef82d450e 100644
--- a/plugins/pst-import/pst-importer.c
+++ b/plugins/pst-import/pst-importer.c
@@ -551,10 +551,12 @@ org_credativ_evolution_readpst_getwidget (EImport *ei,
g_signal_connect (w, "selected", G_CALLBACK (folder_selected), target);
gtk_box_pack_end ((GtkBox *) hbox, w, FALSE, FALSE, 0);
g_signal_connect (check, "toggled", G_CALLBACK (widget_sanitizer_cb), w);
+ widget_sanitizer_cb (GTK_TOGGLE_BUTTON (check), w);
w = gtk_label_new (_("Destination folder:"));
gtk_box_pack_end ((GtkBox *) hbox, w, FALSE, TRUE, 6);
g_signal_connect (check, "toggled", G_CALLBACK (widget_sanitizer_cb), w);
+ widget_sanitizer_cb (GTK_TOGGLE_BUTTON (check), w);
gtk_box_pack_start ((GtkBox *) framebox, hbox, FALSE, FALSE, 0);
@@ -1113,6 +1115,61 @@ attachment_to_part (PstImporter *m,
}
static void
+dequote_string (gchar *str)
+{
+ if (str[0] == '\'' || str[0] == '\"') {
+ gint len = strlen (str);
+
+ if (len > 1 && (str[len - 1] == '\'' || str[len - 1] == '\"')) {
+ str[0] = ' ';
+ str[len - 1] = ' ';
+ g_strstrip (str);
+ }
+ }
+}
+
+static gboolean
+lookup_address (pst_item *item, const gchar *str, gboolean is_unique, CamelAddress *addr)
+{
+ gboolean res = FALSE;
+ gchar *address;
+
+ if (!item || !str || !*str || !addr)
+ return FALSE;
+
+ address = g_strdup (str);
+ dequote_string (address);
+
+ if (item->contact && item->file_as.str &&
+ (is_unique || g_str_equal (item->file_as.str, str)) &&
+ item->contact->address1.str &&
+ item->contact->address1_transport.str &&
+ g_ascii_strcasecmp (item->contact->address1_transport.str, "SMTP") == 0 &&
+ !g_str_equal (address, item->contact->address1.str)) {
+ gchar *tmp = address;
+
+ address = g_strconcat ("\"", address, "\" <", item->contact->address1.str, ">", NULL);
+
+ g_free (tmp);
+ }
+
+ res = camel_address_decode (addr, address) > 0;
+
+ g_free (address);
+
+ return res;
+}
+
+static const gchar *
+strip_smtp (const gchar *str)
+{
+ if (str && g_ascii_strncasecmp (str, "SMTP:", 5) == 0)
+ return str + 5;
+
+ return str;
+}
+
+static void
pst_process_email (PstImporter *m,
pst_item *item)
{
@@ -1201,11 +1258,11 @@ pst_process_email (PstImporter *m,
addr = camel_internet_address_new ();
if (item->email->outlook_sender_name.str != NULL && item->email->outlook_sender.str != NULL) {
- camel_internet_address_add (addr, item->email->outlook_sender_name.str, item->email->outlook_sender.str);
+ camel_internet_address_add (addr, item->email->outlook_sender_name.str, strip_smtp (item->email->outlook_sender.str));
} else if (item->email->outlook_sender_name.str != NULL) {
- camel_address_decode (CAMEL_ADDRESS (addr), item->email->outlook_sender_name.str);
+ camel_address_decode (CAMEL_ADDRESS (addr), strip_smtp (item->email->outlook_sender_name.str));
} else if (item->email->outlook_sender.str != NULL) {
- camel_address_decode (CAMEL_ADDRESS (addr), item->email->outlook_sender.str);
+ camel_address_decode (CAMEL_ADDRESS (addr), strip_smtp (item->email->outlook_sender.str));
} else {
/* Evo prints a warning if no from is set, so supply an empty address */
camel_internet_address_add (addr, "", "");
@@ -1237,7 +1294,7 @@ pst_process_email (PstImporter *m,
if (item->email->sentto_address.str != NULL) {
addr = camel_internet_address_new ();
- if (camel_address_decode (CAMEL_ADDRESS (addr), item->email->sentto_address.str) > 0)
+ if (lookup_address (item, item->email->sentto_address.str, item->email->cc_address.str == NULL, CAMEL_ADDRESS (addr)))
camel_mime_message_set_recipients (msg, "To", addr);
g_object_unref (addr);
@@ -1246,7 +1303,7 @@ pst_process_email (PstImporter *m,
if (item->email->cc_address.str != NULL) {
addr = camel_internet_address_new ();
- if (camel_address_decode (CAMEL_ADDRESS (addr), item->email->cc_address.str) > 0)
+ if (lookup_address (item, item->email->cc_address.str, item->email->sentto_address.str == NULL, CAMEL_ADDRESS (addr)))
camel_mime_message_set_recipients (msg, "CC", addr);
g_object_unref (addr);
diff --git a/shell/main.c b/shell/main.c
index fe12559748..0b042d4d40 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -482,10 +482,6 @@ main (gint argc,
textdomain (GETTEXT_PACKAGE);
g_type_init ();
- #if !GLIB_CHECK_VERSION(2,31,0)
- if (!g_thread_get_initialized ())
- g_thread_init (NULL);
- #endif
/* do not require Gtk+ for --force-shutdown */
if (argc == 2 && argv[1] && g_str_equal (argv[1], "--force-shutdown")) {