diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-10-07 11:38:52 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-10-13 01:58:59 +0800 |
commit | a06e4484b8df804124b5bcf88d94dec5acfba270 (patch) | |
tree | 4fa42793d7dc461f2b3767296d76592182c48222 /modules/mail/e-mail-shell-sidebar.c | |
parent | 5e0758bb6934a7859b1d8a247c8fb21c156772cf (diff) | |
download | gsoc2013-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 'modules/mail/e-mail-shell-sidebar.c')
-rw-r--r-- | modules/mail/e-mail-shell-sidebar.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/mail/e-mail-shell-sidebar.c b/modules/mail/e-mail-shell-sidebar.c index ac736a0a67..bc1cbcdda2 100644 --- a/modules/mail/e-mail-shell-sidebar.c +++ b/modules/mail/e-mail-shell-sidebar.c @@ -23,6 +23,7 @@ #include "e-util/e-binding.h" +#include "mail/e-mail-backend.h" #include "mail/e-mail-sidebar.h" #include "mail/em-folder-utils.h" @@ -116,10 +117,13 @@ mail_shell_sidebar_constructed (GObject *object) { EMailShellSidebar *mail_shell_sidebar; EShellSettings *shell_settings; + EShellBackend *shell_backend; EShellSidebar *shell_sidebar; EShellWindow *shell_window; EShellView *shell_view; EShell *shell; + EMailBackend *backend; + EMailSession *session; GtkTreeSelection *selection; GtkTreeView *tree_view; GtkWidget *container; @@ -130,11 +134,15 @@ 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); shell_window = e_shell_view_get_shell_window (shell_view); shell = e_shell_window_get_shell (shell_window); shell_settings = e_shell_get_shell_settings (shell); + backend = E_MAIL_BACKEND (shell_backend); + session = e_mail_backend_get_session (backend); + mail_shell_sidebar = E_MAIL_SHELL_SIDEBAR (object); /* Build sidebar widgets. */ @@ -152,7 +160,7 @@ mail_shell_sidebar_constructed (GObject *object) container = widget; - widget = e_mail_sidebar_new (); + widget = e_mail_sidebar_new (session); gtk_container_add (GTK_CONTAINER (container), widget); mail_shell_sidebar->priv->folder_tree = g_object_ref (widget); gtk_widget_show (widget); |