diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-05-24 05:09:24 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-06-30 00:42:19 +0800 |
commit | 7050475f84247fb15e24aa1bb31502106c18815d (patch) | |
tree | 60e500f221d5f97b241045b10806c5c4ddbcc7c1 /capplet | |
parent | a98cb0a9820d2119bf10c317e5f6a9d56dd9073c (diff) | |
download | gsoc2013-evolution-7050475f84247fb15e24aa1bb31502106c18815d.tar gsoc2013-evolution-7050475f84247fb15e24aa1bb31502106c18815d.tar.gz gsoc2013-evolution-7050475f84247fb15e24aa1bb31502106c18815d.tar.bz2 gsoc2013-evolution-7050475f84247fb15e24aa1bb31502106c18815d.tar.lz gsoc2013-evolution-7050475f84247fb15e24aa1bb31502106c18815d.tar.xz gsoc2013-evolution-7050475f84247fb15e24aa1bb31502106c18815d.tar.zst gsoc2013-evolution-7050475f84247fb15e24aa1bb31502106c18815d.zip |
EMFolderTree: Store an EMailBackend instead of an EMailSession.
All this so EMFolderTree can submit EActivity instances for async ops.
You can obtain an EMailSession from an EMailBackend, but not vice versa.
Creates lots of pretty ripples in the mail code, but ultimately reduces
complexity. So it's a code cleanup of sorts.
Diffstat (limited to 'capplet')
-rw-r--r-- | capplet/settings/mail-account-view.c | 10 | ||||
-rw-r--r-- | capplet/settings/mail-account-view.h | 2 | ||||
-rw-r--r-- | capplet/settings/mail-capplet-shell.c | 12 | ||||
-rw-r--r-- | capplet/settings/mail-view.c | 2 | ||||
-rw-r--r-- | capplet/settings/mail-view.h | 4 |
5 files changed, 16 insertions, 14 deletions
diff --git a/capplet/settings/mail-account-view.c b/capplet/settings/mail-account-view.c index 128e541f91..128e0f1558 100644 --- a/capplet/settings/mail-account-view.c +++ b/capplet/settings/mail-account-view.c @@ -32,7 +32,7 @@ #include <libedataserver/e-account-list.h> #include "mail-view.h" #include "e-util/e-config.h" -#include "mail/e-mail-session.h" +#include "mail/e-mail-backend.h" #include "mail-guess-servers.h" struct _MailAccountViewPrivate { @@ -1035,7 +1035,7 @@ next_page (GtkWidget *entry, MailAccountView *mav) static void mail_account_view_construct (MailAccountView *view, - EMailSession *session) + EMailBackend *backend) { gint i; EShell *shell; @@ -1058,7 +1058,7 @@ mail_account_view_construct (MailAccountView *view, view->current_page = 0; gtk_box_pack_start ((GtkBox *) view, view->scroll, TRUE, TRUE, 0); view->edit = em_account_editor_new_for_pages ( - view->original, EMAE_PAGES, session, + view->original, EMAE_PAGES, backend, "org.gnome.evolution.mail.config.accountWizard", view->wpages); gtk_widget_hide (e_config_create_widget (E_CONFIG (view->edit->config))); view->edit->emae_check_servers = emae_check_servers; @@ -1096,13 +1096,13 @@ mail_account_view_construct (MailAccountView *view, MailAccountView * mail_account_view_new (EAccount *account, - EMailSession *session) + EMailBackend *backend) { MailAccountView *view = g_object_new (MAIL_ACCOUNT_VIEW_TYPE, NULL); view->type = MAIL_VIEW_ACCOUNT; view->uri = "account://"; view->original = account; - mail_account_view_construct (view, session); + mail_account_view_construct (view, backend); return view; } diff --git a/capplet/settings/mail-account-view.h b/capplet/settings/mail-account-view.h index ac03b1a536..1b04533403 100644 --- a/capplet/settings/mail-account-view.h +++ b/capplet/settings/mail-account-view.h @@ -87,7 +87,7 @@ typedef struct _MailAccountViewClass { } MailAccountViewClass; GType mail_account_view_get_type (void); -MailAccountView *mail_account_view_new (EAccount *account, EMailSession *session); +MailAccountView *mail_account_view_new (EAccount *account, EMailBackend *backend); GtkWidget * mail_account_view_get_tab_widget (MailAccountView *mcv); void mail_account_view_activate (MailAccountView *mcv, GtkWidget *tree, GtkWidget *folder_tree, GtkWidget *check_mail, GtkWidget *sort_by, gboolean act); #endif diff --git a/capplet/settings/mail-capplet-shell.c b/capplet/settings/mail-capplet-shell.c index fecc0a67ad..2908531e57 100644 --- a/capplet/settings/mail-capplet-shell.c +++ b/capplet/settings/mail-capplet-shell.c @@ -66,7 +66,7 @@ static guint mail_capplet_shell_signals[LAST_SIGNAL]; struct _MailCappletShellPrivate { - EMailSession *session; + EMailBackend *backend; GtkWidget *box; GtkWidget * top_bar; @@ -202,6 +202,7 @@ mail_capplet_shell_construct (MailCappletShell *shell, gint socket_id, gboolean { MailCappletShellPrivate *priv = shell->priv; GtkStyle *style = gtk_widget_get_default_style (); + EMailSession *session; gchar *custom_dir; gtk_window_set_icon_name ((GtkWindow *)shell, "evolution"); @@ -238,17 +239,18 @@ mail_capplet_shell_construct (MailCappletShell *shell, gint socket_id, gboolean camel_provider_init (); - shell->priv->session = e_mail_session_new (); + shell->priv->backend = g_object_new (E_TYPE_MAIL_BACKEND, NULL); + session = e_mail_backend_get_session (shell->priv->backend); shell->view = mail_view_new (); - shell->view->session = shell->priv->session; + shell->view->backend = shell->priv->backend; gtk_widget_show ((GtkWidget *) shell->view); gtk_box_pack_end ((GtkBox *) priv->box, (GtkWidget *) shell->view, TRUE, TRUE, 2); - mail_config_init (shell->priv->session); + mail_config_init (session); mail_msg_init (); custom_dir = g_build_filename (e_get_user_data_dir (), "mail", NULL); - e_mail_store_init (shell->priv->session, custom_dir); + e_mail_store_init (session, custom_dir); g_free (custom_dir); if (just_druid) { diff --git a/capplet/settings/mail-view.c b/capplet/settings/mail-view.c index 71fdf07dc3..67a86d7872 100644 --- a/capplet/settings/mail-view.c +++ b/capplet/settings/mail-view.c @@ -433,7 +433,7 @@ mail_view_add_account (MailView *mv, MailAccountView *msv; gint position = 0; - msv = mail_account_view_new (data, mv->session); + msv = mail_account_view_new (data, mv->backend); gtk_widget_show ((GtkWidget *) msv); if (!block) mv->priv->current_view = (MailViewChild *) msv; diff --git a/capplet/settings/mail-view.h b/capplet/settings/mail-view.h index 558bb945a7..6f814fd81e 100644 --- a/capplet/settings/mail-view.h +++ b/capplet/settings/mail-view.h @@ -24,7 +24,7 @@ #define _MAIL_VIEW_H_ #include <shell/e-shell-view.h> -#include <mail/e-mail-session.h> +#include <mail/e-mail-backend.h> #include "anjal-mail-view.h" @@ -48,7 +48,7 @@ typedef struct _MailViewPrivate MailViewPrivate; typedef struct _MailView { AnjalMailView parent; - EMailSession *session; + EMailBackend *backend; GtkWidget *tree; /* Actual tree */ GtkWidget *folder_tree; GtkWidget *slider; |