diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-03-26 23:05:06 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-03-26 23:05:06 +0800 |
commit | 7f6f4dfde87156779c89f57b0ebc8150c7acca7e (patch) | |
tree | 5dfcc834dba5d02d44a5b28425864425dcb79afb /mail/e-mail-reader.c | |
parent | cb10cf2a8e7bf697caab441e03e9056b863ae739 (diff) | |
download | gsoc2013-evolution-7f6f4dfde87156779c89f57b0ebc8150c7acca7e.tar.gz gsoc2013-evolution-7f6f4dfde87156779c89f57b0ebc8150c7acca7e.tar.zst gsoc2013-evolution-7f6f4dfde87156779c89f57b0ebc8150c7acca7e.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.c | 38 |
1 files changed, 12 insertions, 26 deletions
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c index 6448f5bf35..d3ffde3597 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; |