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,
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;
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)
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();
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();
return;
}
}
- textview_write_line(textview, "\n", NULL);
+ textview_write_line(textview, "\n", NULL, FALSE);
sc_html_parser_destroy(parser);
}
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();
#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;
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);
} 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);