From 7f6f4dfde87156779c89f57b0ebc8150c7acca7e Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 26 Mar 2010 11:05:06 -0400 Subject: 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(). --- widgets/misc/e-web-view.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'widgets/misc/e-web-view.c') diff --git a/widgets/misc/e-web-view.c b/widgets/misc/e-web-view.c index c65f9cf666..d245437e84 100644 --- a/widgets/misc/e-web-view.c +++ b/widgets/misc/e-web-view.c @@ -856,6 +856,16 @@ web_view_extract_uri (EWebView *web_view, return uri; } +static void +web_view_load_string (EWebView *web_view, + const gchar *string) +{ + if (string != NULL && *string != '\0') + gtk_html_load_from_string (GTK_HTML (web_view), string, -1); + else + e_web_view_clear (web_view); +} + static void web_view_copy_clipboard (EWebView *web_view) { @@ -1078,6 +1088,7 @@ e_web_view_class_init (EWebViewClass *class) html_class->iframe_created = web_view_iframe_created; class->extract_uri = web_view_extract_uri; + class->load_string = web_view_load_string; class->copy_clipboard = web_view_copy_clipboard; class->cut_clipboard = web_view_cut_clipboard; class->paste_clipboard = web_view_paste_clipboard; @@ -1435,12 +1446,14 @@ void e_web_view_load_string (EWebView *web_view, const gchar *string) { + EWebViewClass *class; + g_return_if_fail (E_IS_WEB_VIEW (web_view)); - if (string != NULL && *string != '\0') - gtk_html_load_from_string (GTK_HTML (web_view), string, -1); - else - e_web_view_clear (web_view); + class = E_WEB_VIEW_GET_CLASS (web_view); + g_return_if_fail (class->load_string != NULL); + + class->load_string (web_view, string); } gboolean -- cgit v1.2.3