aboutsummaryrefslogtreecommitdiffstats
path: root/mail/e-mail-notebook-view.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-10-07 11:38:52 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-10-13 01:58:59 +0800
commita06e4484b8df804124b5bcf88d94dec5acfba270 (patch)
tree4fa42793d7dc461f2b3767296d76592182c48222 /mail/e-mail-notebook-view.c
parent5e0758bb6934a7859b1d8a247c8fb21c156772cf (diff)
downloadgsoc2013-evolution-a06e4484b8df804124b5bcf88d94dec5acfba270.tar.gz
gsoc2013-evolution-a06e4484b8df804124b5bcf88d94dec5acfba270.tar.zst
gsoc2013-evolution-a06e4484b8df804124b5bcf88d94dec5acfba270.zip
Give MailSession a permanent home.
Global variables in shared libraries are a bad idea. EMailBackend now owns the MailSession instance, which is actually now EMailSession. Move the blocking utility functions in mail-tools.c to e-mail-session.c and add asynchronous variants. Same approach as Camel. Replace EMailReader.get_shell_backend() with EMailReader.get_backend(), which returns an EMailBackend. Easier access to the EMailSession.
Diffstat (limited to 'mail/e-mail-notebook-view.c')
-rw-r--r--mail/e-mail-notebook-view.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/mail/e-mail-notebook-view.c b/mail/e-mail-notebook-view.c
index 3d8ae70f8f..9b0d36076b 100644
--- a/mail/e-mail-notebook-view.c
+++ b/mail/e-mail-notebook-view.c
@@ -735,6 +735,20 @@ mail_notebook_view_get_action_group (EMailReader *reader)
return E_SHELL_WINDOW_ACTION_GROUP_MAIL (shell_window);
}
+static EMailBackend *
+mail_notebook_view_get_backend (EMailReader *reader)
+{
+ EMailView *view;
+ EShellView *shell_view;
+ EShellBackend *shell_backend;
+
+ view = E_MAIL_VIEW (reader);
+ shell_view = e_mail_view_get_shell_view (view);
+ shell_backend = e_shell_view_get_shell_backend (shell_view);
+
+ return E_MAIL_BACKEND (shell_backend);
+}
+
static EMFormatHTML *
mail_notebook_view_get_formatter (EMailReader *reader)
{
@@ -793,18 +807,6 @@ mail_notebook_view_get_popup_menu (EMailReader *reader)
return e_mail_reader_get_popup_menu (reader);
}
-static EShellBackend *
-mail_notebook_view_get_shell_backend (EMailReader *reader)
-{
- EMailView *view;
- EShellView *shell_view;
-
- view = E_MAIL_VIEW (reader);
- shell_view = e_mail_view_get_shell_view (view);
-
- return e_shell_view_get_shell_backend (shell_view);
-}
-
static GtkWindow *
mail_notebook_view_get_window (EMailReader *reader)
{
@@ -1261,11 +1263,11 @@ static void
e_mail_notebook_view_reader_init (EMailReaderInterface *interface)
{
interface->get_action_group = mail_notebook_view_get_action_group;
+ interface->get_backend = mail_notebook_view_get_backend;
interface->get_formatter = mail_notebook_view_get_formatter;
interface->get_hide_deleted = mail_notebook_view_get_hide_deleted;
interface->get_message_list = mail_notebook_view_get_message_list;
interface->get_popup_menu = mail_notebook_view_get_popup_menu;
- interface->get_shell_backend = mail_notebook_view_get_shell_backend;
interface->get_window = mail_notebook_view_get_window;
interface->set_folder = mail_notebook_view_set_folder;
interface->show_search_bar = mail_notebook_view_show_search_bar;