From a06e4484b8df804124b5bcf88d94dec5acfba270 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 6 Oct 2010 23:38:52 -0400 Subject: 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. --- plugins/groupwise-features/install-shared.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'plugins/groupwise-features/install-shared.c') diff --git a/plugins/groupwise-features/install-shared.c b/plugins/groupwise-features/install-shared.c index 92d5ae6aab..b216d49085 100644 --- a/plugins/groupwise-features/install-shared.c +++ b/plugins/groupwise-features/install-shared.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -155,17 +156,24 @@ accept_free (gpointer data) static void apply_clicked (GtkAssistant *assistant, CamelMimeMessage *msg) { + EShell *shell; + EShellBackend *shell_backend; + EMailSession *session; EMFolderTree *folder_tree; GtkWidget *dialog; struct AcceptData *accept_data; gchar *uri; gpointer parent; + shell = e_shell_get_default (); + shell_backend = e_shell_get_backend_by_name (shell, "mail"); + session = e_mail_backend_get_session (E_MAIL_BACKEND (shell_backend)); + parent = gtk_widget_get_toplevel (GTK_WIDGET (assistant)); parent = gtk_widget_is_toplevel (parent) ? parent : NULL; accept_data = g_new0 (struct AcceptData, 1); - folder_tree = (EMFolderTree *) em_folder_tree_new (); + folder_tree = (EMFolderTree *) em_folder_tree_new (session); dialog = em_folder_selector_create_new (parent, folder_tree, 0, _("Create folder"), _("Specify where to create the folder:")); uri = em_folder_tree_get_selected_uri (folder_tree); -- cgit v1.2.3