From 7636c4705148cd31f842de134448918381dc2045 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 8 Jan 2010 15:52:05 -0500 Subject: =?UTF-8?q?Bug=C2=A0606344=20-=20Clicking=20"Reply=20to=20All"=20b?= =?UTF-8?q?utton=20causes=20Evo=20to=20dump=20core?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adding a GtkhtmlEditor::uri-requested repeater signal was a mistake. It unnecessarily complicates URI handling and so the composer no longer uses it -- instead it connects to GtkHTML::url-requested directly. This also requires commit 203ce61e6ea19323914b9c459b2e79bde5db15be from GtkHTML to work right. That commit changes GtkHTML::url-requested to a G_SIGNAL_RUN_LAST so the composer's signal handler runs first. If the composer can handle the URI request, it stops the signal emission so that nothing else tries to use the freed GtkHTMLStream. Henceforth consider GtkhtmlEditor::uri-requested to be deprecated. --- composer/e-msg-composer.c | 72 ----------------------------------------------- 1 file changed, 72 deletions(-) (limited to 'composer/e-msg-composer.c') diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index eed3893d95..e9b388bc50 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -57,25 +57,6 @@ #include "em-format/em-format-quote.h" #include "misc/e-web-view.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#if defined (HAVE_NSS) -#include -#endif - #include "e-msg-composer.h" #include "e-attachment.h" #include "e-composer-autosave.h" @@ -2098,58 +2079,6 @@ msg_composer_object_deleted (GtkhtmlEditor *editor) gtkhtml_editor_set_paragraph_data (editor, "signature", "0"); } -static void -msg_composer_uri_requested (GtkhtmlEditor *editor, - const gchar *uri, - GtkHTMLStream *stream) -{ - GtkhtmlEditorClass *editor_class; - EMsgComposer *composer; - GHashTable *hash_table; - GByteArray *array; - CamelDataWrapper *wrapper; - CamelStream *camel_stream; - CamelMimePart *part; - GtkHTML *html; - - /* XXX It's unfortunate we have to expose GtkHTML structs here. - * Maybe we could rework this to use a GOutputStream. */ - - composer = E_MSG_COMPOSER (editor); - html = gtkhtml_editor_get_html (editor); - - hash_table = composer->priv->inline_images_by_url; - part = g_hash_table_lookup (hash_table, uri); - - if (part == NULL) { - hash_table = composer->priv->inline_images; - part = g_hash_table_lookup (hash_table, uri); - } - - if (part == NULL) - goto chainup; - - array = g_byte_array_new (); - camel_stream = camel_stream_mem_new_with_byte_array (array); - wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part)); - camel_data_wrapper_decode_to_stream (wrapper, camel_stream); - - gtk_html_write ( - gtkhtml_editor_get_html (editor), stream, - (gchar *) array->data, array->len); - - camel_object_unref (camel_stream); - - gtk_html_end (html, stream, GTK_HTML_STREAM_OK); - - return; - -chainup: - /* Chain up to parent's uri_requested() method. */ - editor_class = GTKHTML_EDITOR_CLASS (parent_class); - editor_class->uri_requested (editor, uri, stream); -} - static void msg_composer_class_init (EMsgComposerClass *class) { @@ -2187,7 +2116,6 @@ msg_composer_class_init (EMsgComposerClass *class) editor_class->image_uri = msg_composer_image_uri; editor_class->link_clicked = msg_composer_link_clicked; editor_class->object_deleted = msg_composer_object_deleted; - editor_class->uri_requested = msg_composer_uri_requested; g_object_class_install_property ( object_class, -- cgit v1.2.3