aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-rw-r--r--mail/e-mail-reader-utils.c5
-rw-r--r--mail/e-mail-reader.c10
-rw-r--r--mail/e-mail-shell-migrate.c13
-rw-r--r--mail/e-mail-shell-sidebar.c9
-rw-r--r--mail/e-mail-shell-view-actions.c20
-rw-r--r--mail/e-mail-shell-view-private.c16
-rw-r--r--mail/e-mail-shell-view-private.h1
-rw-r--r--mail/em-composer-utils.c4
-rw-r--r--mail/em-folder-properties.c4
-rw-r--r--mail/em-folder-tree-model.c12
-rw-r--r--mail/em-utils.c19
-rw-r--r--mail/importers/mail-importer.c4
-rw-r--r--mail/mail-session.c4
13 files changed, 80 insertions, 41 deletions
diff --git a/mail/e-mail-reader-utils.c b/mail/e-mail-reader-utils.c
index 3e069bac06..96fe1baad8 100644
--- a/mail/e-mail-reader-utils.c
+++ b/mail/e-mail-reader-utils.c
@@ -189,6 +189,7 @@ e_mail_reader_mark_selected (EMailReader *reader,
guint
e_mail_reader_open_selected (EMailReader *reader)
{
+ EMailShellBackend *mail_shell_backend;
EShellBackend *shell_backend;
MessageList *message_list;
CamelFolder *folder;
@@ -204,6 +205,8 @@ e_mail_reader_open_selected (EMailReader *reader)
shell_backend = e_mail_reader_get_shell_backend (reader);
window = e_mail_reader_get_window (reader);
+ mail_shell_backend = E_MAIL_SHELL_BACKEND (shell_backend);
+
folder = message_list->folder;
folder_uri = message_list->folder_uri;
uids = message_list_get_selected (message_list);
@@ -276,7 +279,7 @@ e_mail_reader_open_selected (EMailReader *reader)
const gchar *uid = views->pdata[ii];
GtkWidget *browser;
- browser = e_mail_browser_new (shell_backend);
+ browser = e_mail_browser_new (mail_shell_backend);
e_mail_reader_set_folder (
E_MAIL_READER (browser), folder, folder_uri);
e_mail_reader_set_message (
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index c65feaae2d..7b50774153 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -157,7 +157,8 @@ action_mail_copy_cb (GtkAction *action,
message_list = e_mail_reader_get_message_list (reader);
shell_backend = e_mail_reader_get_shell_backend (reader);
- model = e_mail_shell_backend_get_folder_tree_model (shell_backend);
+ model = e_mail_shell_backend_get_folder_tree_model (
+ E_MAIL_SHELL_BACKEND (shell_backend));
folder_tree = em_folder_tree_new_with_model (model);
selected = message_list_get_selected (message_list);
@@ -577,7 +578,8 @@ action_mail_move_cb (GtkAction *action,
message_list = e_mail_reader_get_message_list (reader);
shell_backend = e_mail_reader_get_shell_backend (reader);
- model = e_mail_shell_backend_get_folder_tree_model (shell_backend);
+ model = e_mail_shell_backend_get_folder_tree_model (
+ E_MAIL_SHELL_BACKEND (shell_backend));
folder_tree = em_folder_tree_new_with_model (model);
selected = message_list_get_selected (message_list);
@@ -900,6 +902,7 @@ action_mail_show_source_cb (GtkAction *action,
EMailReader *reader)
{
EMFormatHTMLDisplay *html_display;
+ EMailShellBackend *mail_shell_backend;
EShellBackend *shell_backend;
MessageList *message_list;
CamelFolder *folder;
@@ -909,13 +912,14 @@ action_mail_show_source_cb (GtkAction *action,
message_list = e_mail_reader_get_message_list (reader);
shell_backend = e_mail_reader_get_shell_backend (reader);
+ mail_shell_backend = E_MAIL_SHELL_BACKEND (shell_backend);
folder = message_list->folder;
folder_uri = message_list->folder_uri;
uids = message_list_get_selected (message_list);
g_return_if_fail (uids->len > 0);
- browser = e_mail_browser_new (shell_backend);
+ browser = e_mail_browser_new (mail_shell_backend);
reader = E_MAIL_READER (browser);
html_display = e_mail_reader_get_html_display (reader);
em_format_set_mode (EM_FORMAT (html_display), EM_FORMAT_SOURCE);
diff --git a/mail/e-mail-shell-migrate.c b/mail/e-mail-shell-migrate.c
index 99469b1d6d..b7af75beb2 100644
--- a/mail/e-mail-shell-migrate.c
+++ b/mail/e-mail-shell-migrate.c
@@ -2853,7 +2853,8 @@ migrate_to_db (EShellBackend *shell_backend)
camel_exception_init (&ex);
e_mail_shell_backend_load_store_by_uri (
- shell_backend, service->url, name);
+ E_MAIL_SHELL_BACKEND (shell_backend),
+ service->url, name);
store = (CamelStore *) camel_session_get_service (CAMEL_SESSION (session), service->url, CAMEL_PROVIDER_STORE, &ex);
info = camel_store_get_folder_info (store, NULL, CAMEL_STORE_FOLDER_INFO_RECURSIVE|CAMEL_STORE_FOLDER_INFO_FAST|CAMEL_STORE_FOLDER_INFO_SUBSCRIBED, &ex);
@@ -2879,11 +2880,11 @@ migrate_to_db (EShellBackend *shell_backend)
}
gboolean
-e_mail_shell_backend_migrate (EShellBackend *shell_backend,
- gint major,
- gint minor,
- gint micro,
- GError **error)
+e_mail_shell_migrate (EShellBackend *shell_backend,
+ gint major,
+ gint minor,
+ gint micro,
+ GError **error)
{
struct stat st;
const gchar *data_dir;
diff --git a/mail/e-mail-shell-sidebar.c b/mail/e-mail-shell-sidebar.c
index e71fe4d6b2..d8d591e671 100644
--- a/mail/e-mail-shell-sidebar.c
+++ b/mail/e-mail-shell-sidebar.c
@@ -128,6 +128,7 @@ static void
mail_shell_sidebar_constructed (GObject *object)
{
EMailShellSidebarPrivate *priv;
+ EMailShellBackend *mail_shell_backend;
EShellSidebar *shell_sidebar;
EShellBackend *shell_backend;
EShellView *shell_view;
@@ -144,6 +145,7 @@ mail_shell_sidebar_constructed (GObject *object)
shell_sidebar = E_SHELL_SIDEBAR (object);
shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
shell_backend = e_shell_view_get_shell_backend (shell_view);
+ mail_shell_backend = E_MAIL_SHELL_BACKEND (mail_shell_backend);
/* Build sidebar widgets. */
@@ -160,7 +162,7 @@ mail_shell_sidebar_constructed (GObject *object)
container = widget;
- widget = em_folder_tree_new (shell_backend);
+ widget = em_folder_tree_new (mail_shell_backend);
em_folder_tree_set_excluded (EM_FOLDER_TREE (widget), 0);
em_folder_tree_enable_drag_and_drop (EM_FOLDER_TREE (widget));
gtk_container_add (GTK_CONTAINER (container), widget);
@@ -179,6 +181,7 @@ mail_shell_sidebar_constructed (GObject *object)
static guint32
mail_shell_sidebar_check_state (EShellSidebar *shell_sidebar)
{
+ EMailShellBackend *mail_shell_backend;
EMailShellSidebar *mail_shell_sidebar;
EShellBackend *shell_backend;
EShellView *shell_view;
@@ -203,7 +206,9 @@ mail_shell_sidebar_check_state (EShellSidebar *shell_sidebar)
shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
shell_backend = e_shell_view_get_shell_backend (shell_view);
- local_store = e_mail_shell_backend_get_local_store (shell_backend);
+
+ mail_shell_backend = E_MAIL_SHELL_BACKEND (shell_backend);
+ local_store = e_mail_shell_backend_get_local_store (mail_shell_backend);
mail_shell_sidebar = E_MAIL_SHELL_SIDEBAR (shell_sidebar);
folder_tree = e_mail_shell_sidebar_get_folder_tree (mail_shell_sidebar);
diff --git a/mail/e-mail-shell-view-actions.c b/mail/e-mail-shell-view-actions.c
index 2491e41a46..33d497c9ae 100644
--- a/mail/e-mail-shell-view-actions.c
+++ b/mail/e-mail-shell-view-actions.c
@@ -45,18 +45,16 @@ static void
action_mail_account_disable_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
+ EMailShellBackend *mail_shell_backend;
EMailShellSidebar *mail_shell_sidebar;
- EShellBackend *shell_backend;
- EShellView *shell_view;
EMFolderTree *folder_tree;
EAccountList *account_list;
EAccount *account;
gchar *folder_uri;
- shell_view = E_SHELL_VIEW (mail_shell_view);
- shell_backend = e_shell_view_get_shell_backend (shell_view);
-
+ mail_shell_backend = mail_shell_view->priv->mail_shell_backend;
mail_shell_sidebar = mail_shell_view->priv->mail_shell_sidebar;
+
folder_tree = e_mail_shell_sidebar_get_folder_tree (mail_shell_sidebar);
folder_uri = em_folder_tree_get_selected_uri (folder_tree);
g_return_if_fail (folder_uri != NULL);
@@ -70,7 +68,8 @@ action_mail_account_disable_cb (GtkAction *action,
account->enabled = !account->enabled;
e_account_list_change (account_list, account);
- e_mail_shell_backend_remove_store_by_uri (shell_backend, folder_uri);
+ e_mail_shell_backend_remove_store_by_uri (
+ mail_shell_backend, folder_uri);
if (account->parent_uid != NULL)
e_account_list_remove (account_list, account);
@@ -100,14 +99,13 @@ static void
action_mail_download_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- EShellView *shell_view;
- EShellBackend *shell_backend;
+ EMailShellBackend *mail_shell_backend;
- shell_view = E_SHELL_VIEW (mail_shell_view);
- shell_backend = e_shell_view_get_shell_backend (shell_view);
+ mail_shell_backend = mail_shell_view->priv->mail_shell_backend;
e_mail_shell_backend_stores_foreach (
- shell_backend, (GHFunc) action_mail_download_foreach_cb, NULL);
+ mail_shell_backend, (GHFunc)
+ action_mail_download_foreach_cb, NULL);
}
static void
diff --git a/mail/e-mail-shell-view-private.c b/mail/e-mail-shell-view-private.c
index e31292ed65..615001ecb2 100644
--- a/mail/e-mail-shell-view-private.c
+++ b/mail/e-mail-shell-view-private.c
@@ -212,6 +212,7 @@ e_mail_shell_view_private_constructed (EMailShellView *mail_shell_view)
EMailShellSidebar *mail_shell_sidebar;
EShell *shell;
EShellView *shell_view;
+ EShellBackend *shell_backend;
EShellContent *shell_content;
EShellSettings *shell_settings;
EShellSidebar *shell_sidebar;
@@ -232,6 +233,7 @@ e_mail_shell_view_private_constructed (EMailShellView *mail_shell_view)
gint ii = 0;
shell_view = E_SHELL_VIEW (mail_shell_view);
+ shell_backend = e_shell_view_get_shell_backend (shell_view);
shell_content = e_shell_view_get_shell_content (shell_view);
shell_sidebar = e_shell_view_get_shell_sidebar (shell_view);
shell_window = e_shell_view_get_shell_window (shell_view);
@@ -251,6 +253,7 @@ e_mail_shell_view_private_constructed (EMailShellView *mail_shell_view)
priv->label_merge_id = merge_id;
/* Cache these to avoid lots of awkward casting. */
+ priv->mail_shell_backend = g_object_ref (shell_backend);
priv->mail_shell_content = g_object_ref (shell_content);
priv->mail_shell_sidebar = g_object_ref (shell_sidebar);
@@ -359,6 +362,7 @@ e_mail_shell_view_private_dispose (EMailShellView *mail_shell_view)
EMailShellViewPrivate *priv = mail_shell_view->priv;
gint ii;
+ DISPOSE (priv->mail_shell_backend);
DISPOSE (priv->mail_shell_content);
DISPOSE (priv->mail_shell_sidebar);
@@ -742,8 +746,9 @@ e_mail_shell_view_create_vfolder_from_selected (EMailShellView *mail_shell_view,
void
e_mail_shell_view_update_sidebar (EMailShellView *mail_shell_view)
{
+ EMailShellBackend *mail_shell_backend;
+ EMailShellContent *mail_shell_content;
EShellSidebar *shell_sidebar;
- EShellBackend *shell_backend;
EShellView *shell_view;
EMailReader *reader;
MessageList *message_list;
@@ -763,16 +768,19 @@ e_mail_shell_view_update_sidebar (EMailShellView *mail_shell_view)
g_return_if_fail (E_IS_MAIL_SHELL_VIEW (mail_shell_view));
+ mail_shell_backend = mail_shell_view->priv->mail_shell_backend;
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+
shell_view = E_SHELL_VIEW (mail_shell_view);
- shell_backend = e_shell_view_get_shell_backend (shell_view);
shell_sidebar = e_shell_view_get_shell_sidebar (shell_view);
- local_store = e_mail_shell_backend_get_local_store (shell_backend);
- reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content);
+ reader = E_MAIL_READER (mail_shell_content);
message_list = e_mail_reader_get_message_list (reader);
folder_uri = message_list->folder_uri;
folder = message_list->folder;
+ local_store = e_mail_shell_backend_get_local_store (mail_shell_backend);
+
/* If no folder is selected, reset the sidebar banners
* to their default values and stop. */
if (folder == NULL) {
diff --git a/mail/e-mail-shell-view-private.h b/mail/e-mail-shell-view-private.h
index 6034dbcc66..1d61f8d68d 100644
--- a/mail/e-mail-shell-view-private.h
+++ b/mail/e-mail-shell-view-private.h
@@ -122,6 +122,7 @@ struct _EMailShellViewPrivate {
/*** Other Stuff ***/
/* These are just for convenience. */
+ EMailShellBackend *mail_shell_backend;
EMailShellContent *mail_shell_content;
EMailShellSidebar *mail_shell_sidebar;
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c
index 66863faf64..b522ca1861 100644
--- a/mail/em-composer-utils.c
+++ b/mail/em-composer-utils.c
@@ -2538,14 +2538,14 @@ em_utils_post_reply_to_message_by_uid (CamelFolder *folder, const char *uid)
static void
post_header_clicked_cb (EComposerPostHeader *header,
- EShellBackend *shell_backend)
+ EMailShellBackend *mail_shell_backend)
{
EMFolderTreeModel *model;
GtkWidget *folder_tree;
GtkWidget *dialog;
GList *list;
- model = e_mail_shell_backend_get_folder_tree_model (shell_backend);
+ model = e_mail_shell_backend_get_folder_tree_model (mail_shell_backend);
folder_tree = em_folder_tree_new_with_model (model);
em_folder_tree_set_multiselect (
diff --git a/mail/em-folder-properties.c b/mail/em-folder-properties.c
index e346aa3fab..c8b56b2c3c 100644
--- a/mail/em-folder-properties.c
+++ b/mail/em-folder-properties.c
@@ -317,7 +317,9 @@ emfp_dialog_got_folder_quota (CamelFolder *folder,
shell_view = E_SHELL_VIEW (data);
shell_backend = e_shell_view_get_shell_backend (shell_view);
shell_window = e_shell_view_get_shell_window (shell_view);
- local_store = e_mail_shell_backend_get_local_store (shell_backend);
+
+ local_store = e_mail_shell_backend_get_local_store (
+ E_MAIL_SHELL_BACKEND (shell_backend));
prop_data = g_malloc0 (sizeof (*prop_data));
prop_data->object = folder;
diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c
index 289df103fd..abdd3c8b6f 100644
--- a/mail/em-folder-tree-model.c
+++ b/mail/em-folder-tree-model.c
@@ -496,8 +496,8 @@ em_folder_tree_model_new (EMailShellBackend *mail_shell_backend)
"shell-backend", mail_shell_backend, NULL);
}
-EShellBackend *
-em_folder_tree_model_get_shell_backend (EMFolderTreeModel *model)
+EMailShellBackend *
+em_folder_tree_model_get_mail_shell_backend (EMFolderTreeModel *model)
{
g_return_val_if_fail (EM_IS_FOLDER_TREE_MODEL (model), NULL);
@@ -560,6 +560,7 @@ em_folder_tree_model_set_folder_info (EMFolderTreeModel *model, GtkTreeIter *ite
CamelFolderInfo *fi, int fully_loaded)
{
EShellBackend *shell_backend;
+ EMailShellBackend *mail_shell_backend;
GtkTreeRowReference *uri_row, *path_row;
GtkTreeStore *tree_store;
unsigned int unread;
@@ -578,6 +579,7 @@ em_folder_tree_model_set_folder_info (EMFolderTreeModel *model, GtkTreeIter *ite
tree_store = GTK_TREE_STORE (model);
shell_backend = model->priv->shell_backend;
+ mail_shell_backend = E_MAIL_SHELL_BACKEND (shell_backend);
if (!fully_loaded)
load = fi->child == NULL && !(fi->flags & (CAMEL_FOLDER_NOCHILDREN | CAMEL_FOLDER_NOINFERIORS));
@@ -599,9 +601,9 @@ em_folder_tree_model_set_folder_info (EMFolderTreeModel *model, GtkTreeIter *ite
CamelFolder *local_outbox;
local_drafts = e_mail_shell_backend_get_folder (
- shell_backend, E_MAIL_FOLDER_DRAFTS);
+ mail_shell_backend, E_MAIL_FOLDER_DRAFTS);
local_outbox = e_mail_shell_backend_get_folder (
- shell_backend, E_MAIL_FOLDER_OUTBOX);
+ mail_shell_backend, E_MAIL_FOLDER_OUTBOX);
if (folder == local_outbox) {
int total;
@@ -634,7 +636,7 @@ em_folder_tree_model_set_folder_info (EMFolderTreeModel *model, GtkTreeIter *ite
/* TODO: maybe this should be handled by mail_get_folderinfo (except em-folder-tree doesn't use it, duh) */
flags = fi->flags;
name = fi->name;
- if (si->store == e_mail_shell_backend_get_local_store (shell_backend)) {
+ if (si->store == e_mail_shell_backend_get_local_store (mail_shell_backend)) {
if (!strcmp(fi->full_name, "Drafts")) {
name = _("Drafts");
} else if (!strcmp(fi->full_name, "Templates")) {
diff --git a/mail/em-utils.c b/mail/em-utils.c
index db7f99afe8..45f54abbcf 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -255,13 +255,16 @@ static GtkWidget *filter_editor = NULL;
static void
em_filter_editor_response (GtkWidget *dialog, int button, gpointer user_data)
{
+ EShellBackend *shell_backend;
EMFilterContext *fc;
+ shell_backend = E_SHELL_BACKEND (global_mail_shell_backend);
+
if (button == GTK_RESPONSE_OK) {
const gchar *data_dir;
char *user;
- data_dir = e_shell_backend_get_data_dir (global_mail_shell_backend);
+ data_dir = e_shell_backend_get_data_dir (shell_backend);
fc = g_object_get_data ((GObject *) dialog, "context");
user = g_strdup_printf ("%s/filters.xml", data_dir);
rule_context_save ((RuleContext *) fc, user);
@@ -290,6 +293,7 @@ static EMFilterSource em_filter_source_element_names[] = {
void
em_utils_edit_filters (GtkWidget *parent)
{
+ EShellBackend *shell_backend;
const gchar *data_dir;
char *user, *system;
EMFilterContext *fc;
@@ -299,7 +303,8 @@ em_utils_edit_filters (GtkWidget *parent)
return;
}
- data_dir = e_shell_backend_get_data_dir (global_mail_shell_backend);
+ shell_backend = E_SHELL_BACKEND (global_mail_shell_backend);
+ data_dir = e_shell_backend_get_data_dir (shell_backend);
fc = em_filter_context_new ();
user = g_build_filename (data_dir, "filters.xml", NULL);
@@ -2434,10 +2439,13 @@ em_utils_clear_get_password_canceled_accounts_flag (void)
void
em_utils_show_error_silent (GtkWidget *widget)
{
+ EShellBackend *shell_backend;
EActivity *activity;
+ shell_backend = E_SHELL_BACKEND (global_mail_shell_backend);
+
activity = e_alert_activity_new_warning (widget);
- e_shell_backend_add_activity (global_mail_shell_backend, activity);
+ e_shell_backend_add_activity (shell_backend, activity);
g_object_unref (activity);
if (g_object_get_data (G_OBJECT (widget), "response-handled") == NULL)
@@ -2449,10 +2457,13 @@ em_utils_show_error_silent (GtkWidget *widget)
void
em_utils_show_info_silent (GtkWidget *widget)
{
+ EShellBackend *shell_backend;
EActivity *activity;
+ shell_backend = E_SHELL_BACKEND (global_mail_shell_backend);
+
activity = e_alert_activity_new_info (widget);
- e_shell_backend_add_activity (global_mail_shell_backend, activity);
+ e_shell_backend_add_activity (shell_backend, activity);
g_object_unref (activity);
if (g_object_get_data (G_OBJECT (widget), "response-handled") == NULL)
diff --git a/mail/importers/mail-importer.c b/mail/importers/mail-importer.c
index dbae51dfcb..ebf79e88b8 100644
--- a/mail/importers/mail-importer.c
+++ b/mail/importers/mail-importer.c
@@ -357,6 +357,7 @@ struct _import_folders_data {
static void
import_folders_rec(struct _import_folders_data *m, const char *filepath, const char *folderparent)
{
+ EShellBackend *shell_backend;
GDir *dir;
const char *d;
struct stat st;
@@ -368,7 +369,8 @@ import_folders_rec(struct _import_folders_data *m, const char *filepath, const c
if (dir == NULL)
return;
- data_dir = e_shell_backend_get_data_dir (global_mail_shell_backend);
+ shell_backend = E_SHELL_BACKEND (global_mail_shell_backend);
+ data_dir = e_shell_backend_get_data_dir (shell_backend);
utf8_filename = g_filename_to_utf8 (filepath, -1, NULL, NULL, NULL);
camel_operation_start(NULL, _("Scanning %s"), utf8_filename);
diff --git a/mail/mail-session.c b/mail/mail-session.c
index 5cb61e9f71..c236a144d1 100644
--- a/mail/mail-session.c
+++ b/mail/mail-session.c
@@ -503,6 +503,7 @@ session_system_beep (CamelFilterDriver *driver, gpointer user_data)
static CamelFilterDriver *
main_get_filter_driver (CamelSession *session, const char *type, CamelException *ex)
{
+ EShellBackend *shell_backend;
CamelFilterDriver *driver;
FilterRule *rule = NULL;
const gchar *data_dir;
@@ -511,8 +512,9 @@ main_get_filter_driver (CamelSession *session, const char *type, CamelException
RuleContext *fc;
gconf = mail_config_get_gconf_client ();
+ shell_backend = E_SHELL_BACKEND (session_mail_shell_backend);
- data_dir = e_shell_backend_get_data_dir (session_mail_shell_backend);
+ data_dir = e_shell_backend_get_data_dir (shell_backend);
user = g_build_filename (data_dir, "filters.xml", NULL);
system = g_build_filename (EVOLUTION_PRIVDATADIR, "filtertypes.xml", NULL);
fc = (RuleContext *) em_filter_context_new ();