2005-09-13 [colin] 1.9.14cvs23
authorColin Leroy <colin@colino.net>
Tue, 13 Sep 2005 16:33:02 +0000 (16:33 +0000)
committerColin Leroy <colin@colino.net>
Tue, 13 Sep 2005 16:33:02 +0000 (16:33 +0000)
* src/compose.c
Test utf8 compliance before inserting to
buffer, and try to convert if necessary
* src/procmime.c
If no charset is present, use the locale
one instead of us-ascii
* src/procmsg.c
Add Sender, List-Post and To in the checked
headers for automatic rules creation
(thanks to wwp)
* src/prefs_themes.c
* src/gtk/gtkaspell.c
Remove deprecated functions.
patch by Daniel Gustafson

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/compose.c
src/gtk/gtkaspell.c
src/prefs_themes.c
src/procmime.c
src/procmsg.c

index 07d6f65d28d75cdf856a496e3834426f22af3fdb..d4e6b03e5bc4530bbff09c4bff7c5ff24801c50f 100644 (file)
@@ -1,3 +1,20 @@
+2005-09-13 [colin]     1.9.14cvs23
+
+       * src/compose.c
+               Test utf8 compliance before inserting to 
+               buffer, and try to convert if necessary
+       * src/procmime.c
+               If no charset is present, use the locale 
+               one instead of us-ascii
+       * src/procmsg.c
+               Add Sender, List-Post and To in the checked 
+               headers for automatic rules creation 
+               (thanks to wwp)
+       * src/prefs_themes.c
+       * src/gtk/gtkaspell.c
+               Remove deprecated functions. 
+               patch by Daniel Gustafson
+
 2005-09-12 [colin]     1.9.14cvs22
 
        * src/compose.c
index 2f533881d57978798ae26af9256b975f9e4468ff..cf9e65e16f6fb128c74e8e3931a94d8050fd41af 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.382.2.165 -r 1.382.2.166 src/compose.c;  cvs diff -u -r 1.213.2.55 -r 1.213.2.56 src/folder.c;  cvs diff -u -r 1.5.2.10 -r 1.5.2.11 src/prefs_spelling.c;  cvs diff -u -r 1.1.4.11 -r 1.1.4.12 src/common/xml.c;  ) > 1.9.14cvs20.patchset
 ( cvs diff -u -r 1.100.2.25 -r 1.100.2.26 AUTHORS;  cvs diff -u -r 1.1.4.9 -r 1.1.4.10 src/gtk/logwindow.c;  ) > 1.9.14cvs21.patchset
 ( cvs diff -u -r 1.382.2.166 -r 1.382.2.167 src/compose.c;  cvs diff -u -r 1.274.2.64 -r 1.274.2.65 src/mainwindow.c;  cvs diff -u -r 1.395.2.122 -r 1.395.2.123 src/summaryview.c;  cvs diff -u -r 1.68.2.11 -r 1.68.2.12 src/summaryview.h;  ) > 1.9.14cvs22.patchset
+( cvs diff -u -r 1.382.2.167 -r 1.382.2.168 src/compose.c;  cvs diff -u -r 1.3.2.25 -r 1.3.2.26 src/prefs_themes.c;  cvs diff -u -r 1.49.2.58 -r 1.49.2.59 src/procmime.c;  cvs diff -u -r 1.150.2.43 -r 1.150.2.44 src/procmsg.c;  cvs diff -u -r 1.9.2.21 -r 1.9.2.22 src/gtk/gtkaspell.c;  ) > 1.9.14cvs23.patchset
index d7b488c690306ba089a0fd9d493c013a63d3cb20..27003d6064d06bc8c3e4d59f08e9373545d948b9 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=14
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=22
+EXTRA_VERSION=23
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 0b92adaf1f5a5472758e3472a77a727945772804..55f0cbae8cea36528e6afa31af28b48dec042707 100644 (file)
@@ -2078,7 +2078,19 @@ static gchar *compose_quote_fmt(Compose *compose, MsgInfo *msginfo,
                lastp = strchr(p, '\n');
                len = lastp ? lastp - p + 1 : -1;
 
-               gtk_text_buffer_insert(buffer, &iter, p, len);
+               if (g_utf8_validate(p, -1, NULL)) { 
+                       gtk_text_buffer_insert(buffer, &iter, p, len);
+               } else {
+                       gchar *tmpin = g_strdup(p);
+                       gchar *tmpout = NULL;
+                       tmpin[len] = '\0';
+                       tmpout = conv_codeset_strdup
+                               (tmpin, conv_get_locale_charset_str(),
+                                CS_INTERNAL);
+                       gtk_text_buffer_insert(buffer, &iter, tmpout, -1);
+                       g_free(tmpin);
+                       g_free(tmpout);
+               }
 
                if (lastp)
                        p = lastp + 1;
index 82d980ffd973862759fb1871d03c1c4e57cb07ed..e8e26f87e9febcb0fbf77ddaa9f0ba433979aebd 100644 (file)
@@ -808,9 +808,11 @@ static void set_sug_mode_cb(GtkMenuItem *w, GtkAspell *gtkaspell)
 {
        char *themode;
        
-       gtk_label_get(GTK_LABEL(GTK_BIN(w)->child), (gchar **) &themode);
+       themode = (char *) gtk_label_get_text(GTK_LABEL(GTK_BIN(w)->child));
+       themode = g_strdup(themode);
        
        set_real_sug_mode(gtkaspell, themode);
+       g_free(themode);
 
        if (gtkaspell->config_menu)
                populate_submenu(gtkaspell, gtkaspell->config_menu);
@@ -1258,7 +1260,8 @@ static void replace_word_cb(GtkWidget *w, gpointer data)
        GtkAspell *gtkaspell = (GtkAspell *) data;
        GdkEvent *e= (GdkEvent *) gtk_get_current_event();
 
-       gtk_label_get(GTK_LABEL(GTK_BIN(w)->child), (gchar**) &newword);
+       newword = (unsigned char *) gtk_label_get_text(GTK_LABEL(GTK_BIN(w)->child));
+       newword = g_strdup(newword);
 
        replace_real_word(gtkaspell, newword);
 
@@ -1275,6 +1278,7 @@ static void replace_word_cb(GtkWidget *w, gpointer data)
        gtk_menu_shell_deactivate(GTK_MENU_SHELL(w->parent));
 
        set_point_continue(gtkaspell);
+       g_free(newword);
 }
 
 static void replace_real_word(GtkAspell *gtkaspell, gchar *newword)
index b18545972e46c132e5566032ab64ae96b79bea6b..3f8e70bcaf76dc37ae0df81398cc0183314a4be9 100644 (file)
@@ -852,7 +852,7 @@ static void prefs_themes_create_widget(PrefsPage *page, GtkWindow *window, gpoin
        GTK_WIDGET_SET_FLAGS (btn_more, GTK_CAN_DEFAULT);
        /* make it look like an uri */
        gtk_button_set_relief(GTK_BUTTON(btn_more), GTK_RELIEF_NONE);
-       gtk_label_get(GTK_LABEL(GTK_BIN(btn_more)->child), &buf);
+       buf = gtk_label_get_text(GTK_LABEL(GTK_BIN(btn_more)->child));
        buf = g_strdup(buf);
        for (i = 0; buf[i] != '\0'; buf[i++] = '_');
        gtk_label_set_pattern(GTK_LABEL(GTK_BIN(btn_more)->child), buf);
index fc671d7e974ee57e30ea71b449cd8832ff16cc2d..ab0d11bb3eaefc0771c6a7dfbd5948b6c0b43016 100644 (file)
@@ -736,7 +736,7 @@ FILE *procmime_get_text_content(MimeInfo *mimeinfo)
                oldout = dup(1);
                
                dup2(fileno(outfp), 1);
-               
+
                p = popen(renderer->renderer, "w");
                if (p != NULL) {
                        size_t count;
@@ -1614,7 +1614,7 @@ static void procmime_parse_content_type(const gchar *content_type, MimeInfo *mim
                                       "charset") == NULL)
                        g_hash_table_insert(mimeinfo->typeparameters,
                                            g_strdup("charset"),
-                                           g_strdup("us-ascii"));
+                                           g_strdup(conv_get_locale_charset_str()));
        } else {
                gchar *type, *subtype, *params;
 
@@ -1716,7 +1716,8 @@ int procmime_parse_mimepart(MimeInfo *parent,
                mimeinfo->subtype = g_strdup("plain");
                if (g_hash_table_lookup(mimeinfo->typeparameters,
                                       "charset") == NULL)
-                       g_hash_table_insert(mimeinfo->typeparameters, g_strdup("charset"), g_strdup("us-ascii"));
+                       g_hash_table_insert(mimeinfo->typeparameters, g_strdup("charset"), 
+                               g_strdup(conv_get_locale_charset_str()));
        }
 
        if (content_encoding != NULL) {
index c1de1cc44050408235279bf3753f2a7c459650b2..cb9be31a31ed8f0fd4de706b0c995e0cb4502989 100644 (file)
@@ -549,6 +549,8 @@ void procmsg_get_filter_keyword(MsgInfo *msginfo, gchar **header, gchar **key,
                                       {"X-Mailing-list:", NULL, TRUE},
                                       {"List-Id:",        NULL, TRUE},
                                       {"X-Sequence:",     NULL, TRUE},
+                                      {"Sender:",         NULL, TRUE},
+                                      {"List-Post:",      NULL, TRUE},
                                       {NULL,              NULL, FALSE}};
        enum
        {
@@ -557,7 +559,9 @@ void procmsg_get_filter_keyword(MsgInfo *msginfo, gchar **header, gchar **key,
                H_X_LIST         = 2,
                H_X_MAILING_LIST = 3,
                H_LIST_ID        = 4,
-               H_X_SEQUENCE     = 5
+               H_X_SEQUENCE     = 5,
+               H_SENDER         = 6,
+               H_LIST_POST      = 7
        };
 
        FILE *fp;
@@ -610,6 +614,13 @@ void procmsg_get_filter_keyword(MsgInfo *msginfo, gchar **header, gchar **key,
                                }
                        }
                        g_strstrip(*key);
+               } else if (hentry[H_SENDER].body != NULL) {
+                       SET_FILTER_KEY("header \"Sender\"", H_SENDER);
+               } else if (hentry[H_LIST_POST].body != NULL) {
+                       SET_FILTER_KEY("header \"Sender\"", H_LIST_POST);
+               } else if (msginfo->to) {
+                       *header = g_strdup("to");
+                       *key = g_strdup(msginfo->to);
                } else if (msginfo->subject) {
                        *header = g_strdup("subject");
                        *key = g_strdup(msginfo->subject);
@@ -627,6 +638,10 @@ void procmsg_get_filter_keyword(MsgInfo *msginfo, gchar **header, gchar **key,
                hentry[H_X_MAILING_LIST].body = NULL;
                g_free(hentry[H_LIST_ID].body);
                hentry[H_LIST_ID].body = NULL;
+               g_free(hentry[H_SENDER].body);
+               hentry[H_SENDER].body = NULL;
+               g_free(hentry[H_LIST_POST].body);
+               hentry[H_LIST_POST].body = NULL;
 
                break;
        case FILTER_BY_FROM: