2005-02-06 [colin] 1.0.0cvs28.3
authorColin Leroy <colin@colino.net>
Sun, 6 Feb 2005 20:24:40 +0000 (20:24 +0000)
committerColin Leroy <colin@colino.net>
Sun, 6 Feb 2005 20:24:40 +0000 (20:24 +0000)
* src/compose.c
Make compose a bit faster - patch by Alfons.

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/compose.c

index 9a85ac0..18c1e52 100644 (file)
@@ -1,3 +1,8 @@
+2005-02-06 [colin]     1.0.0cvs28.3
+
+       * src/compose.c
+               Make compose a bit faster - patch by Alfons.
+
 2005-02-06 [colin]     1.0.0cvs28.2
 
        * src/compose.c
index e8c7bc3..280f4f8 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.2504.2.44 -r 1.2504.2.45 ChangeLog.claws; cvs diff -u -r 1.654.2.392 -r 1.654.2.393 configure.ac; cvs diff -u -r 1.1.2.2 -r 1.1.2.3 src/partial_download.c; ) > 1.0.0cvs27.1.patchset
 ( cvs diff -u -r 1.396.2.20 -r 1.396.2.21 ChangeLog; cvs diff -u -r 1.2504.2.45 -r 1.2504.2.46 ChangeLog.claws; cvs diff -u -r 1.391.2.20 -r 1.391.2.21 ChangeLog.jp; cvs diff -u -r 1.654.2.393 -r 1.654.2.394 configure.ac; cvs diff -u -r 1.382.2.93 -r 1.382.2.94 src/compose.c; ) > 1.0.0cvs28.1.patchset
 ( cvs diff -u -r 1.382.2.94 -r 1.382.2.95 src/compose.c; ) > 1.0.0cvs28.2.patchset
+( cvs diff -u -r 1.382.2.95 -r 1.382.2.96 src/compose.c; ) > 1.0.0cvs28.3.patchset
index d390ab7..15a2af2 100644 (file)
@@ -13,7 +13,7 @@ INTERFACE_AGE=0
 BINARY_AGE=0
 EXTRA_VERSION=28
 EXTRA_RELEASE=
-EXTRA_GTK2_VERSION=.2
+EXTRA_GTK2_VERSION=.3
 
 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}${EXTRA_RELEASE}${EXTRA_GTK2_VERSION}
index dc414f4..146741d 100644 (file)
@@ -1332,26 +1332,18 @@ void compose_reedit(MsgInfo *msginfo)
                                        G_CALLBACK(compose_changed_cb),
                                        compose);
                                        
-       g_signal_handlers_block_by_func(G_OBJECT(textbuf),
-                                       G_CALLBACK(text_inserted),
-                                       compose);
-
        if ((fp = procmime_get_first_text_content(msginfo)) == NULL)
                g_warning("Can't get text part\n");
        else {
                while (fgets(buf, sizeof(buf), fp) != NULL) {
                        strcrchomp(buf);
                        gtk_text_buffer_insert(textbuf, &iter, buf, -1);
-                       gtk_text_buffer_get_iter_at_mark(textbuf, &iter, mark);
                }
                fclose(fp);
        }
        
        compose_attach_parts(compose, msginfo);
 
-       g_signal_handlers_unblock_by_func(G_OBJECT(textbuf),
-                                       G_CALLBACK(text_inserted),
-                                       compose);
        g_signal_handlers_unblock_by_func(G_OBJECT(textbuf),
                                        G_CALLBACK(compose_changed_cb),
                                        compose);
@@ -7416,8 +7408,14 @@ static void text_inserted(GtkTextBuffer *buffer, GtkTextIter *iter,
 {
        gint paste_as_quotation = GPOINTER_TO_INT(g_object_get_data
                                (G_OBJECT(compose->text), "paste_as_quotation"));
+       GtkTextMark *mark;
+
+       /* CLAWS: pass to default handler only if not pasting as quotation, and 
+        * no autowrap */
+       if (!paste_as_quotation && !compose->autowrap) 
+               return;
 
-       g_return_if_fail(text);
+       g_return_if_fail(text != NULL);
 
        g_signal_handlers_block_by_func(G_OBJECT(buffer),
                                        G_CALLBACK(text_inserted),
@@ -7442,8 +7440,10 @@ static void text_inserted(GtkTextBuffer *buffer, GtkTextIter *iter,
        } else
                gtk_text_buffer_insert(buffer, iter, text, len);
 
-       if (compose->autowrap)
-               compose_wrap_line_all_full(compose, TRUE);
+       mark = gtk_text_buffer_create_mark(buffer, NULL, iter, FALSE);
+       compose_wrap_line_all_full(compose, TRUE);
+       gtk_text_buffer_get_iter_at_mark(buffer, iter, mark);
+       gtk_text_buffer_delete_mark(buffer, mark);
 
        g_signal_handlers_unblock_by_func(G_OBJECT(buffer),
                                          G_CALLBACK(text_inserted),
@@ -7455,7 +7455,6 @@ static void text_inserted(GtkTextBuffer *buffer, GtkTextIter *iter,
                compose->draft_timeout_tag = gtk_timeout_add
                        (500, (GtkFunction) compose_defer_auto_save_draft, compose);
 }
-
 static gint compose_defer_auto_save_draft(Compose *compose)
 {
        compose->draft_timeout_tag = -1;