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 /plugins/groupwise-features/install-shared.c | |
parent | 5e0758bb6934a7859b1d8a247c8fb21c156772cf (diff) | |
download | gsoc2013-evolution-a06e4484b8df804124b5bcf88d94dec5acfba270.tar gsoc2013-evolution-a06e4484b8df804124b5bcf88d94dec5acfba270.tar.gz gsoc2013-evolution-a06e4484b8df804124b5bcf88d94dec5acfba270.tar.bz2 gsoc2013-evolution-a06e4484b8df804124b5bcf88d94dec5acfba270.tar.lz gsoc2013-evolution-a06e4484b8df804124b5bcf88d94dec5acfba270.tar.xz 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 'plugins/groupwise-features/install-shared.c')
-rw-r--r-- | plugins/groupwise-features/install-shared.c | 10 |
1 files changed, 9 insertions, 1 deletions
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 <gconf/gconf-client.h> #include <e-util/e-config.h> #include <shell/e-shell.h> +#include <mail/e-mail-backend.h> #include <mail/em-config.h> #include <mail/em-event.h> #include <mail/em-folder-tree.h> @@ -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); |