2006-10-06 [colin] 2.5.3cvs11
authorColin Leroy <colin@colino.net>
Fri, 6 Oct 2006 16:55:13 +0000 (16:55 +0000)
committerColin Leroy <colin@colino.net>
Fri, 6 Oct 2006 16:55:13 +0000 (16:55 +0000)
* src/textview.c
Don't do quote folding on HTML or ERTF.
May fix the Cygwin issues if they were
happening with HTML mails?

ChangeLog
PATCHSETS
configure.ac
src/textview.c

index d33d72a0d877cfb5783f345d7b7986548b672455..785d5162568c9e64aa4e1d8e7f7b259aeabcbec7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-10-06 [colin]     2.5.3cvs11
+
+       * src/textview.c
+               Don't do quote folding on HTML or ERTF.
+               May fix the Cygwin issues if they were
+               happening with HTML mails?
+
 2006-10-05 [colin]     2.5.3cvs10
 
        * src/prefs_gtk.c
index 050c3d2366ef349f5db57dc012b0b820496d9d9f..a1b69440f6cb21a4995b3d9be9116ececd745a6f 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.207.2.128 -r 1.207.2.129 src/folderview.c;  cvs diff -u -r 1.16.2.44 -r 1.16.2.45 src/msgcache.c;  ) > 2.5.3cvs8.patchset
 ( cvs diff -u -r 1.10.2.19 -r 1.10.2.20 src/prefs_gtk.c;  ) > 2.5.3cvs9.patchset
 ( cvs diff -u -r 1.10.2.20 -r 1.10.2.21 src/prefs_gtk.c;  ) > 2.5.3cvs10.patchset
+( cvs diff -u -r 1.96.2.152 -r 1.96.2.153 src/textview.c;  ) > 2.5.3cvs11.patchset
index 46d5afa84d8e4e5c1349e4d3cc497e6d1a82abc1..77b28c46a622b9e563596411315522c764013232 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=5
 MICRO_VERSION=3
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=10
+EXTRA_VERSION=11
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 28fca07ddc8787a8e2d2aae5558f631db5745021..c252e3160f71824636dc880992a0b1d5af59229c 100644 (file)
@@ -151,7 +151,8 @@ static void textview_show_html              (TextView       *textview,
 
 static void textview_write_line                (TextView       *textview,
                                         const gchar    *str,
-                                        CodeConverter  *conv);
+                                        CodeConverter  *conv,
+                                        gboolean        do_quote_folding);
 static void textview_write_link                (TextView       *textview,
                                         const gchar    *str,
                                         const gchar    *uri,
@@ -958,14 +959,14 @@ static void textview_write_body(TextView *textview, MimeInfo *mimeinfo)
                if (pipe(pfd) < 0) {
                        g_snprintf(buf, sizeof(buf),
                                "pipe failed for textview\n\n%s\n", strerror(errno));
-                       textview_write_line(textview, buf, conv);
+                       textview_write_line(textview, buf, conv, TRUE);
                        goto textview_default;
                }
                pid = fork();
                if (pid < 0) {
                        g_snprintf(buf, sizeof(buf),
                                "fork failed for textview\n\n%s\n", strerror(errno));
-                       textview_write_line(textview, buf, conv);
+                       textview_write_line(textview, buf, conv, TRUE);
                        close(pfd[0]);
                        close(pfd[1]);
                        goto textview_default;
@@ -988,7 +989,7 @@ static void textview_write_body(TextView *textview, MimeInfo *mimeinfo)
                close(pfd[1]);
                tmpfp = fdopen(pfd[0], "rb");
                while (fgets(buf, sizeof(buf), tmpfp)) {
-                       textview_write_line(textview, buf, conv);
+                       textview_write_line(textview, buf, conv, TRUE);
                        
                        lines++;
                        if (lines % 500 == 0)
@@ -1013,7 +1014,7 @@ textview_default:
                debug_print("Viewing text content of type: %s (length: %d)\n", mimeinfo->subtype, mimeinfo->length);
                while ((ftell(tmpfp) < mimeinfo->offset + mimeinfo->length) &&
                       (fgets(buf, sizeof(buf), tmpfp) != NULL)) {
-                       textview_write_line(textview, buf, conv);
+                       textview_write_line(textview, buf, conv, TRUE);
                        lines++;
                        if (lines % 500 == 0)
                                GTK_EVENTS_FLUSH();
@@ -1076,7 +1077,7 @@ static void textview_show_html(TextView *textview, FILE *fp,
                        if (str != NULL)
                                textview_write_link(textview, str, parser->href, NULL);
                } else
-                       textview_write_line(textview, str, NULL);
+                       textview_write_line(textview, str, NULL, FALSE);
                lines++;
                if (lines % 500 == 0)
                        GTK_EVENTS_FLUSH();
@@ -1084,7 +1085,7 @@ static void textview_show_html(TextView *textview, FILE *fp,
                        return;
                }
        }
-       textview_write_line(textview, "\n", NULL);
+       textview_write_line(textview, "\n", NULL, FALSE);
        sc_html_parser_destroy(parser);
 }
 
@@ -1099,7 +1100,7 @@ static void textview_show_ertf(TextView *textview, FILE *fp,
        g_return_if_fail(parser != NULL);
 
        while ((str = ertf_parse(parser)) != NULL) {
-               textview_write_line(textview, str, NULL);
+               textview_write_line(textview, str, NULL, FALSE);
                lines++;
                if (lines % 500 == 0)
                        GTK_EVENTS_FLUSH();
@@ -1385,7 +1386,7 @@ static void textview_make_clickable_parts_later(TextView *textview,
 #undef ADD_TXT_POS
 
 static void textview_write_line(TextView *textview, const gchar *str,
-                               CodeConverter *conv)
+                               CodeConverter *conv, gboolean do_quote_folding)
 {
        GtkTextView *text;
        GtkTextBuffer *buffer;
@@ -1438,7 +1439,7 @@ static void textview_write_line(TextView *textview, const gchar *str,
                textview->is_in_signature = TRUE;
        }
 
-       if (real_quotelevel > -1) {
+       if (real_quotelevel > -1 && do_quote_folding) {
                if ( previousquotelevel != real_quotelevel ) {
                        ClickableText *uri;
                        uri = g_new0(ClickableText, 1);
@@ -1463,7 +1464,7 @@ static void textview_write_line(TextView *textview, const gchar *str,
                } else {
                        GSList *last = textview->uri_list;
                        ClickableText *lasturi = (ClickableText *)last->data;
-                       gint e_len = strlen(lasturi->data);
+                       gint e_len = lasturi->data ? strlen(lasturi->data):0;
                        gint n_len = strlen(buf);
                        lasturi->data = g_realloc((gchar *)lasturi->data, e_len + n_len + 1);
                        strcpy((gchar *)lasturi->data + e_len, buf);