aboutsummaryrefslogtreecommitdiffstats
path: root/mail/e-mail-reader.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-03-26 23:05:06 +0800
committerMichael Meeks <michael.meeks@novell.com>2010-04-07 19:23:31 +0800
commit8f42c1dd8fd57e6cb1275e3322e10005466e9d15 (patch)
treea06307eb92e21b53b7ce4bcab7a7ca730c8478f9 /mail/e-mail-reader.c
parent52e458fcfc493c4058ee1ab988da550a53ef4137 (diff)
downloadgsoc2013-evolution-8f42c1dd8fd57e6cb1275e3322e10005466e9d15.tar.gz
gsoc2013-evolution-8f42c1dd8fd57e6cb1275e3322e10005466e9d15.tar.zst
gsoc2013-evolution-8f42c1dd8fd57e6cb1275e3322e10005466e9d15.zip
Minor EMailReader cleanup.
Add a load_string() method to EWebView. Have EMailDisplay override load_string() and check that the formatter is not busy before loading the string. Have EMailReader call e_web_view_load_string() directly on the EMailDisplay instance, and eliminate update_webview_content().
Diffstat (limited to 'mail/e-mail-reader.c')
-rw-r--r--mail/e-mail-reader.c38
1 files changed, 12 insertions, 26 deletions
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index d63118868f..1f7dc7c2b2 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -1787,28 +1787,6 @@ mail_reader_message_read_cb (EMailReader *reader)
}
static void
-update_webview_content (EMailReader *reader, const gchar *content)
-{
- EMFormatHTMLDisplay *html_display;
- EWebView *web_view;
-
- g_return_if_fail (reader != NULL);
- g_return_if_fail (content != NULL);
-
- html_display = e_mail_reader_get_html_display (reader);
- g_return_if_fail (html_display != NULL);
-
- /* skip the progress message when it's formatting something */
- if (em_format_busy (EM_FORMAT (html_display)))
- return;
-
- web_view = E_WEB_VIEW (EM_FORMAT_HTML (html_display)->html);
- g_return_if_fail (web_view != NULL);
-
- e_web_view_load_string (web_view, content);
-}
-
-static void
mail_reader_message_loaded_cb (CamelFolder *folder,
const gchar *message_uid,
CamelMimeMessage *message,
@@ -1822,6 +1800,7 @@ mail_reader_message_loaded_cb (CamelFolder *folder,
EShellBackend *shell_backend;
EShellSettings *shell_settings;
EShell *shell;
+ EWebView *web_view;
EMEvent *event;
EMEventTargetMessage *target;
const gchar *cursor_uid;
@@ -1839,6 +1818,8 @@ mail_reader_message_loaded_cb (CamelFolder *folder,
cursor_uid = MESSAGE_LIST (message_list)->cursor_uid;
+ web_view = E_WEB_VIEW (EM_FORMAT_HTML (html_display)->html);
+
/* If the user picked a different message in the time it took
* to fetch this message, then don't bother rendering it. */
if (g_strcmp0 (cursor_uid, message_uid) != 0)
@@ -1897,10 +1878,11 @@ mail_reader_message_loaded_cb (CamelFolder *folder,
_("Unable to retrieve message"),
ex->desc);
} else {
- string = g_strdup_printf (_("Retrieving message '%s'"), cursor_uid);
+ string = g_strdup_printf (
+ _("Retrieving message '%s'"), cursor_uid);
}
- update_webview_content (reader, string);
+ e_web_view_load_string (web_view, string);
g_free (string);
camel_exception_clear (ex);
@@ -1919,6 +1901,7 @@ mail_reader_message_selected_timeout_cb (EMailReader *reader)
EMailReaderPrivate *priv;
EMFormatHTMLDisplay *html_display;
GtkWidget *message_list;
+ EWebView *web_view;
CamelFolder *folder;
const gchar *cursor_uid;
const gchar *format_uid;
@@ -1932,6 +1915,8 @@ mail_reader_message_selected_timeout_cb (EMailReader *reader)
cursor_uid = MESSAGE_LIST (message_list)->cursor_uid;
format_uid = EM_FORMAT (html_display)->uid;
+ web_view = E_WEB_VIEW (EM_FORMAT_HTML (html_display)->html);
+
if (MESSAGE_LIST (message_list)->last_sel_single) {
GtkWidget *widget;
gboolean html_display_visible;
@@ -1954,8 +1939,9 @@ mail_reader_message_selected_timeout_cb (EMailReader *reader)
gboolean store_async;
MailMsgDispatchFunc disp_func;
- string = g_strdup_printf (_("Retrieving message '%s'"), cursor_uid);
- update_webview_content (reader, string);
+ string = g_strdup_printf (
+ _("Retrieving message '%s'"), cursor_uid);
+ e_web_view_load_string (web_view, string);
g_free (string);
store_async = folder->parent_store->flags & CAMEL_STORE_ASYNC;