2006-08-03 [cleroy] 2.4.0cvs19
authorColin Leroy <colin@colino.net>
Thu, 3 Aug 2006 06:42:12 +0000 (06:42 +0000)
committerColin Leroy <colin@colino.net>
Thu, 3 Aug 2006 06:42:12 +0000 (06:42 +0000)
* src/textview.c
Fix quotes getting toggled back when the
mail has an even number of text parts

ChangeLog
PATCHSETS
configure.ac
src/textview.c

index f2ad8fa218fb062539f9c0618b640012d1a86d60..8cd7745e8e9db3da485683c7fc555afe37d475ae 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-08-03 [cleroy]    2.4.0cvs19
+
+       * src/textview.c
+               Fix quotes getting toggled back when the
+               mail has an even number of text parts
+
 2006-08-02 [colin]     2.4.0cvs18
 
        * src/messageview.c
index 07bfb42a5c28e1d0943243416ee422e4f12bab05..6fc5d881c8d2dcf87483969d227f50fcae23d84a 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.274.2.130 -r 1.274.2.131 src/mainwindow.c;  ) > 2.4.0cvs16.patchset
 ( cvs diff -u -r 1.274.2.131 -r 1.274.2.132 src/mainwindow.c;  cvs diff -u -r 1.204.2.94 -r 1.204.2.95 src/prefs_common.c;  cvs diff -u -r 1.96.2.129 -r 1.96.2.130 src/textview.c;  cvs diff -u -r 1.12.2.11 -r 1.12.2.12 src/textview.h;  cvs diff -u -r 1.4.2.34 -r 1.4.2.35 src/gtk/about.c;  ) > 2.4.0cvs17.patchset
 ( cvs diff -u -r 1.94.2.91 -r 1.94.2.92 src/messageview.c;  ) > 2.4.0cvs18.patchset
+( cvs diff -u -r 1.96.2.130 -r 1.96.2.131 src/textview.c;  ) > 2.4.0cvs19.patchset
index 5d94ed2ed48420f8a5ea89043c1c5fd8ce5a710e..893478e6776959f4bc178c30fb76d6ae1a3e8e9d 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=4
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=18
+EXTRA_VERSION=19
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 99c98983a393cfc96f33a9c5a2e71042506292e3..9beea43007c50548c889193b950c115bc095cabc 100644 (file)
@@ -205,7 +205,9 @@ static gboolean textview_uri_security_check (TextView       *textview,
                                                 ClickableText  *uri);
 static void textview_uri_list_remove_all       (GSList         *uri_list);
 
-static void textview_toggle_quote              (TextView *textview, ClickableText *uri);
+static void textview_toggle_quote              (TextView       *textview, 
+                                                ClickableText  *uri,
+                                                gboolean        expand_only);
 
 static void open_uri_cb                                (TextView       *textview,
                                                 guint           action,
@@ -966,7 +968,7 @@ textview_default:
                        continue;
                if (!prefs_common.hide_quotes ||
                    uri->quote_level+1 < prefs_common.hide_quotes) {
-                       textview_toggle_quote(textview, uri);
+                       textview_toggle_quote(textview, uri, TRUE);
                }
        }
 }
@@ -2290,7 +2292,7 @@ static void textview_remove_uris_in(TextView *textview, gint start, gint end)
        }
 }
 
-static void textview_toggle_quote(TextView *textview, ClickableText *uri)
+static void textview_toggle_quote(TextView *textview, ClickableText *uri, gboolean expand_only)
 {
        GtkTextIter start, end;
        GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview->text));
@@ -2313,6 +2315,7 @@ static void textview_toggle_quote(TextView *textview, ClickableText *uri)
        /* when shifting URIs start and end, we have to do it per-UTF8-char
         * so use g_utf8_strlen(). OTOH, when inserting in the text buffer, 
         * we have to pass a number of bytes, so use strlen(). disturbing. */
+        
        if (!uri->q_expanded) {
                gtk_text_buffer_get_iter_at_offset(buffer, &start, uri->start);
                gtk_text_buffer_get_iter_at_offset(buffer, &end,   uri->end);
@@ -2328,7 +2331,7 @@ static void textview_toggle_quote(TextView *textview, ClickableText *uri)
                textview_make_clickable_parts_later(textview,
                                          uri->start, uri->end);
                uri->q_expanded = TRUE;
-       } else {
+       } else if (!expand_only) {
                gtk_text_buffer_get_iter_at_offset(buffer, &start, uri->start);
                gtk_text_buffer_get_iter_at_offset(buffer, &end,   uri->end);
                textview_remove_uris_in(textview, uri->start, uri->end);
@@ -2395,7 +2398,7 @@ static gboolean textview_uri_button_pressed(GtkTextTag *tag, GObject *obj,
                        } 
                        return TRUE;
                } else if (qlink && bevent->button == 1) {
-                       textview_toggle_quote(textview, uri);
+                       textview_toggle_quote(textview, uri, FALSE);
                        return TRUE;
                                
                } else if (!g_ascii_strncasecmp(uri->uri, "mailto:", 7)) {