2006-12-17 [colin] 2.6.1cvs45
authorColin Leroy <colin@colino.net>
Sun, 17 Dec 2006 11:54:09 +0000 (11:54 +0000)
committerColin Leroy <colin@colino.net>
Sun, 17 Dec 2006 11:54:09 +0000 (11:54 +0000)
* src/gtk/logwindow.c
Fix bug 1067, 'Claws-Mail uses 100% CPU on an
IMAP folder and is blocked on main thread':
make sure we put utf8 in the log.

ChangeLog
PATCHSETS
configure.ac
src/gtk/logwindow.c

index 16c9c25568fe300f5b0efc910eb5c36f1e6b7e88..db32b19c98b4a713079023dd8b39bf1e8b0beb67 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-12-17 [colin]     2.6.1cvs45
+
+       * src/gtk/logwindow.c
+               Fix bug 1067, 'Claws-Mail uses 100% CPU on an 
+               IMAP folder and is blocked on main thread': 
+               make sure we put utf8 in the log.
+
 2006-12-16 [colin]     2.6.1cvs44
 
        * src/toolbar.c
index 393838fedf78fe18de26ac5c75461a1393fb828b..79e20908d4d4e365709882c6aa98e066f16d18ba 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.2.12 -r 1.1.2.13 src/plugins/bogofilter/bogofilter_gtk.c;  ) > 2.6.1cvs42.patchset
 ( cvs diff -u -r 1.53.2.20 -r 1.53.2.21 po/POTFILES.in;  cvs diff -u -r 1.179.2.139 -r 1.179.2.140 src/imap.c;  cvs diff -u -r 1.6.2.10 -r 1.6.2.11 src/common/nntp.c;  cvs diff -u -r 1.23.2.10 -r 1.23.2.11 src/common/session.c;  ) > 2.6.1cvs43.patchset
 ( cvs diff -u -r 1.43.2.56 -r 1.43.2.57 src/toolbar.c;  cvs diff -u -r 1.19.2.12 -r 1.19.2.13 src/toolbar.h;  ) > 2.6.1cvs44.patchset
+( cvs diff -u -r 1.1.4.22 -r 1.1.4.23 src/gtk/logwindow.c;  ) > 2.6.1cvs45.patchset
index f4b948a3a698619a9b0c06e8dff7cedd07b777ce..03df00ef929a2cc8cc3e774fcefc548a08201c76 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=6
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=44
+EXTRA_VERSION=45
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index cc4a3b63c18070af270a7b0991b654916b32d745..7d4e07c3a65248047b227c58ea8bcd481d861c4a 100644 (file)
@@ -291,9 +291,17 @@ static gboolean log_window_append(gpointer source, gpointer data)
        if (head)
                gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, head, -1,
                                                         tag, NULL);
-       gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, logtext->text, -1,
-                                                tag, NULL);
 
+       if (!g_utf8_validate(logtext->text, -1, NULL)) {
+               gchar * mybuf = g_malloc(strlen(logtext->text)*2 +1);
+               conv_localetodisp(mybuf, strlen(logtext->text)*2 +1, logtext->text);
+               gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, mybuf, -1,
+                                                        tag, NULL);
+               g_free(mybuf);
+       } else {
+               gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, logtext->text, -1,
+                                                        tag, NULL);
+       }
        gtk_text_buffer_get_start_iter(buffer, &iter);
 
        if (logwindow->clip)