aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/groupwise-features/proxy.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 /plugins/groupwise-features/proxy.c
parent5e0758bb6934a7859b1d8a247c8fb21c156772cf (diff)
downloadgsoc2013-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/proxy.c')
-rw-r--r--plugins/groupwise-features/proxy.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/plugins/groupwise-features/proxy.c b/plugins/groupwise-features/proxy.c
index beb1c94b30..3d350232db 100644
--- a/plugins/groupwise-features/proxy.c
+++ b/plugins/groupwise-features/proxy.c
@@ -40,7 +40,8 @@
#include <mail/em-account-editor.h>
#include <mail/em-config.h>
#include <mail/mail-ops.h>
-#include <mail/mail-session.h>
+#include <mail/e-mail-backend.h>
+#include <shell/e-shell.h>
#include <libedataserver/e-account.h>
#include <libedataserver/e-account-list.h>
#include <e-util/e-icon-factory.h>
@@ -637,6 +638,9 @@ GtkWidget*
org_gnome_proxy (EPlugin *epl, EConfigHookItemFactoryData *data)
{
EMConfigTargetAccount *target_account;
+ EShell *shell;
+ EShellBackend *shell_backend;
+ EMailSession *session;
EAccount *account;
GtkButton *addProxy, *removeProxy, *editProxy;
proxyDialog *prd;
@@ -644,13 +648,18 @@ org_gnome_proxy (EPlugin *epl, EConfigHookItemFactoryData *data)
CamelOfflineStore *store;
gint pag_num;
+ 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));
+
target_account = (EMConfigTargetAccount *)data->config->target;
account = target_account->account;
/* We are using some g_object_set on this. We shuold also avoid double-free later. So reffing */
g_object_ref (account);
store = (CamelOfflineStore *) camel_session_get_service (
- session, e_account_get_string (account, E_ACCOUNT_SOURCE_URL),
+ CAMEL_SESSION (session),
+ e_account_get_string (account, E_ACCOUNT_SOURCE_URL),
CAMEL_PROVIDER_STORE, NULL);
if (store == NULL)
return NULL;