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-view.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-view.c')
-rw-r--r-- | modules/mail/e-mail-shell-view.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/modules/mail/e-mail-shell-view.c b/modules/mail/e-mail-shell-view.c index d7f77de215..4696a39456 100644 --- a/modules/mail/e-mail-shell-view.c +++ b/modules/mail/e-mail-shell-view.c @@ -212,6 +212,8 @@ mail_shell_view_execute_search (EShellView *shell_view) EShellSettings *shell_settings; EShellSearchbar *searchbar; EActionComboBox *combo_box; + EMailBackend *backend; + EMailSession *session; EMFolderTree *folder_tree; GtkTreeSelection *selection; GtkWidget *message_list; @@ -249,6 +251,9 @@ mail_shell_view_execute_search (EShellView *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_content = E_MAIL_SHELL_CONTENT (shell_content); mail_view = e_mail_shell_content_get_mail_view (mail_shell_content); searchbar = e_mail_shell_content_get_searchbar (mail_shell_content); @@ -550,7 +555,7 @@ all_accounts: /* FIXME Using data_dir like this is not portable. */ uri = g_strdup_printf ("vfolder:%s/vfolder", data_dir); - store = camel_session_get_store (session, uri, NULL); + store = camel_session_get_store (CAMEL_SESSION (session), uri, NULL); g_free (uri); search_folder = (CamelVeeFolder *) camel_vee_folder_new ( @@ -562,7 +567,8 @@ all_accounts: while (iter != NULL) { folder_uri = iter->data; /* FIXME Not passing a GCancellable or GError here. */ - folder = mail_tool_uri_to_folder (folder_uri, 0, NULL, NULL); + folder = e_mail_session_uri_to_folder_sync ( + E_MAIL_SESSION (session), folder_uri, 0, NULL, NULL); if (folder != NULL) list = g_list_append (list, folder); @@ -577,7 +583,8 @@ all_accounts: while (iter != NULL) { folder_uri = iter->data; /* FIXME Not passing a GCancellable or GError here. */ - folder = mail_tool_uri_to_folder (folder_uri, 0, NULL, NULL); + folder = e_mail_session_uri_to_folder_sync ( + E_MAIL_SESSION (session), folder_uri, 0, NULL, NULL); if (folder != NULL) list = g_list_append (list, folder); @@ -733,7 +740,7 @@ current_account: /* FIXME Using data_dir like this is not portable. */ uri = g_strdup_printf ("vfolder:%s/vfolder", data_dir); - store = camel_session_get_store (session, uri, NULL); + store = camel_session_get_store (CAMEL_SESSION (session), uri, NULL); g_free (uri); search_folder = (CamelVeeFolder *) camel_vee_folder_new ( |