aboutsummaryrefslogtreecommitdiffstats
path: root/modules/mail
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-04-01 00:08:36 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-04-01 03:48:01 +0800
commit9ed9a99baddcb87eab366e4f939dc146f2db9401 (patch)
treeb4fb0824904a261fa671973d9a499ed4328c0689 /modules/mail
parentd15cd735886c38ac4c14faa816c307ce8f388844 (diff)
downloadgsoc2013-evolution-9ed9a99baddcb87eab366e4f939dc146f2db9401.tar
gsoc2013-evolution-9ed9a99baddcb87eab366e4f939dc146f2db9401.tar.gz
gsoc2013-evolution-9ed9a99baddcb87eab366e4f939dc146f2db9401.tar.bz2
gsoc2013-evolution-9ed9a99baddcb87eab366e4f939dc146f2db9401.tar.lz
gsoc2013-evolution-9ed9a99baddcb87eab366e4f939dc146f2db9401.tar.xz
gsoc2013-evolution-9ed9a99baddcb87eab366e4f939dc146f2db9401.tar.zst
gsoc2013-evolution-9ed9a99baddcb87eab366e4f939dc146f2db9401.zip
EMFormat: Add "session" as a constructor property.
Pass it in instead of digging it out of EShellSettings.
Diffstat (limited to 'modules/mail')
-rw-r--r--modules/mail/e-mail-attachment-handler.c3
-rw-r--r--modules/mail/e-mail-shell-backend.c29
2 files changed, 21 insertions, 11 deletions
diff --git a/modules/mail/e-mail-attachment-handler.c b/modules/mail/e-mail-attachment-handler.c
index 7e1b8fcddd..00f416c564 100644
--- a/modules/mail/e-mail-attachment-handler.c
+++ b/modules/mail/e-mail-attachment-handler.c
@@ -89,7 +89,8 @@ mail_attachment_handler_forward (GtkAction *action,
style = e_shell_settings_get_int (shell_settings, property_name);
em_utils_forward_message (
- priv->shell, CAMEL_MIME_MESSAGE (wrapper), style, NULL, NULL);
+ priv->shell, CAMEL_SESSION (priv->session),
+ CAMEL_MIME_MESSAGE (wrapper), style, NULL, NULL);
g_list_foreach (selected, (GFunc) g_object_unref, NULL);
g_list_free (selected);
diff --git a/modules/mail/e-mail-shell-backend.c b/modules/mail/e-mail-shell-backend.c
index a30c0240de..f30d8e387d 100644
--- a/modules/mail/e-mail-shell-backend.c
+++ b/modules/mail/e-mail-shell-backend.c
@@ -844,7 +844,7 @@ message_parsed_cb (GObject *source_object,
GObject *preview = user_data;
EMailDisplay *display;
- display = g_object_get_data (preview, "mbox-imp-display");
+ display = g_object_get_data (preview, "mbox-imp-display");
e_mail_display_set_formatter (display, formatter);
e_mail_display_load (display, EM_FORMAT (formatter)->uri_base);
}
@@ -860,10 +860,10 @@ mbox_create_preview_cb (GObject *preview,
g_return_if_fail (preview_widget != NULL);
display = g_object_new (E_TYPE_MAIL_DISPLAY, NULL);
- g_object_set_data_full (preview, "mbox-imp-display",
+ g_object_set_data_full (preview, "mbox-imp-display",
g_object_ref (display), g_object_unref);
- *preview_widget = GTK_WIDGET (display);
+ *preview_widget = GTK_WIDGET (display);
}
static void
@@ -873,7 +873,8 @@ mbox_fill_preview_cb (GObject *preview,
EMailDisplay *display;
EMFormat *formatter;
GHashTable *formatters;
- SoupSession *session;
+ SoupSession *soup_session;
+ EMailSession *mail_session;
gchar *mail_uri;
g_return_if_fail (preview != NULL);
@@ -882,23 +883,31 @@ mbox_fill_preview_cb (GObject *preview,
display = g_object_get_data (preview, "mbox-imp-display");
g_return_if_fail (display != NULL);
- session = webkit_get_default_session ();
- formatters = g_object_get_data (G_OBJECT (session), "formatters");
+ soup_session = webkit_get_default_session ();
+ formatters = g_object_get_data (G_OBJECT (soup_session), "formatters");
if (!formatters) {
formatters = g_hash_table_new_full (g_str_hash, g_str_equal,
(GDestroyNotify) g_free, NULL);
- g_object_set_data (G_OBJECT (session), "formatters", formatters);
+ g_object_set_data (
+ G_OBJECT (soup_session), "formatters", formatters);
}
mail_uri = em_format_build_mail_uri (NULL, msg->message_id, NULL, NULL);
- formatter = EM_FORMAT (em_format_html_display_new ());
+ mail_session = e_mail_session_new ();
+
+ formatter = EM_FORMAT (
+ em_format_html_display_new (
+ CAMEL_SESSION (mail_session)));
formatter->message_uid = g_strdup (msg->message_id);
formatter->uri_base = g_strdup (mail_uri);
/* Don't free the mail_uri!! */
g_hash_table_insert (formatters, mail_uri, formatter);
- em_format_parse_async (formatter, msg, NULL, NULL,
- message_parsed_cb, preview);
+ em_format_parse_async (
+ formatter, msg, NULL, NULL,
+ message_parsed_cb, preview);
+
+ g_object_unref (mail_session);
}