2004-08-21 [colin] 0.9.12cvs66.3
authorColin Leroy <colin@colino.net>
Sat, 21 Aug 2004 08:30:00 +0000 (08:30 +0000)
committerColin Leroy <colin@colino.net>
Sat, 21 Aug 2004 08:30:00 +0000 (08:30 +0000)
* src/compose.c
* src/codeconv.c
Fix warnings
Remove encoding hacks
Fix bug 575 (Strange character messes up message)
Don't display conversion error when drafting

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

index 80e187a144d3cfa11b03bee9e00ee1d9e012c8e0..17d4318e7e27bddd261ca3544b03688b41c45539 100644 (file)
@@ -1,3 +1,12 @@
+2004-08-21 [colin]     0.9.12cvs66.3
+
+       * src/compose.c
+       * src/codeconv.c
+               Fix warnings
+               Remove encoding hacks
+               Fix bug 575 (Strange character messes up message)
+               Don't display conversion error when drafting
+
 2004-08-21 [paul]      0.9.12cvs66.2
 
        * src/prefs_account.c
index 99ab5b654aefc6aa2e3888b1df716e7d124d5821..0287d5eed7029c8485293c251ee67bcc7f948f75 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.9.2.5 -r 1.9.2.6 src/common/ssl.c; cvs diff -u -r 1.1.2.1 -r 1.1.2.3 src/plugins/pgpmime/plugin.c; ) > 0.9.12cvs65.1.patchset
 ( cvs diff -u -r 1.65.2.10 -r 1.65.2.11 src/codeconv.c; ) > 0.9.12cvs66.1.patchset
 ( cvs diff -u -r 1.105.2.7 -r 1.105.2.8 src/prefs_account.c; ) > 0.9.12cvs66.2.patchset
+( cvs diff -u -r 1.382.2.40 -r 1.382.2.41 src/compose.c; cvs diff -u -r 1.65.2.11 -r 1.65.2.12 src/codeconv.c; ) > 0.9.12cvs66.3.patchset
index 25321d14cbfa03dee5fd086f981ab105b1d8c033..068c115f08e4994221c3575c2fe797c9707ea818 100644 (file)
@@ -13,7 +13,7 @@ INTERFACE_AGE=0
 BINARY_AGE=0
 EXTRA_VERSION=66
 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 966da77328ae9147f74fb4bde70f343e15619915..fc042e9370085d54bd71ebb1786e87f0e610c29c 100644 (file)
@@ -909,13 +909,13 @@ gchar *conv_iconv_strdup(const gchar *inbuf,
         * whether iconv is sitting below, or something else */
        gchar *outbuf;
        gsize read_len, written_len;
-       gchar *src_code = conv_get_outgoing_charset_str();
-       gchar *dest_code = conv_get_current_charset_str();
+       gchar *src_code = (char *)conv_get_outgoing_charset_str();
+       gchar *dest_code = (char *)conv_get_current_charset_str();
        
        if (isrc_code)
-               src_code = isrc_code;
+               src_code = (char *)isrc_code;
        if (idest_code)
-               dest_code = idest_code;
+               dest_code = (char *)idest_code;
 
        /* don't convert if current codeset is US-ASCII */
        if (!strcasecmp(dest_code, CS_US_ASCII))
@@ -929,9 +929,6 @@ gchar *conv_iconv_strdup(const gchar *inbuf,
        outbuf = g_convert(inbuf, strlen(inbuf), dest_code, src_code,
                           &read_len, &written_len, NULL);
 
-       if (outbuf == NULL && strcasecmp(src_code, CS_ISO_8859_15)) 
-               /* also try iso-8859-15 */
-               outbuf = conv_iconv_strdup(inbuf, CS_ISO_8859_15, dest_code);
        if (outbuf == NULL)
                g_warning(_("Valid locale type set? (Currently: %s to %s)\n"),
                          src_code, dest_code);
@@ -1505,7 +1502,8 @@ void conv_encode_header(gchar *dest, gint len, const gchar *src,
        const guchar *srcp = src;
        guchar *destp = dest;
        gboolean use_base64;
-
+       gchar *testbuf;
+       
        if (MB_CUR_MAX > 1) {
                use_base64 = TRUE;
                mimesep_enc = "?B?";
@@ -1520,6 +1518,13 @@ void conv_encode_header(gchar *dest, gint len, const gchar *src,
        if (!strcmp(out_encoding, CS_US_ASCII))
                out_encoding = CS_ISO_8859_1;
 
+       testbuf = conv_codeset_strdup(src, cur_encoding, out_encoding);
+       
+       if (testbuf != NULL) 
+               g_free(testbuf);
+       else
+               out_encoding = CS_UTF_8;
+       
        mimestr_len = strlen(MIMESEP_BEGIN) + strlen(out_encoding) +
                strlen(mimesep_enc) + strlen(MIMESEP_END);
 
index 3ed009f5adf54bc6455e9a21ef8181ec6092aabb..7af02f18cedb1cfb64f08e812f7b273288d59a5b 100644 (file)
@@ -3745,16 +3745,18 @@ static gint compose_write_to_file(Compose *compose, const gchar *file,
 
                buf = conv_codeset_strdup(chars, src_codeset, out_codeset);
                if (!buf) {
-                       AlertValue aval;
+                       AlertValue aval = G_ALERTDEFAULT;
                        gchar *msg;
 
-                       msg = g_strdup_printf(_("Can't convert the character encoding of the message from\n"
+                       if (!is_draft) {
+                               msg = g_strdup_printf(_("Can't convert the character encoding of the message from\n"
                                                "%s to %s.\n"
                                                "Send it anyway?"), src_codeset, out_codeset);
-                       aval = alertpanel_with_type
-                               (_("Error"), msg, _("Yes"), _("+No"), NULL, NULL, ALERT_ERROR);
-                       g_free(msg);
-
+                               aval = alertpanel_with_type
+                                       (_("Error"), msg, _("Yes"), _("+No"), NULL, NULL, ALERT_ERROR);
+                               g_free(msg);
+                       }
+                       
                        if (aval != G_ALERTDEFAULT) {
                                g_free(chars);
                                fclose(fp);
@@ -4344,8 +4346,7 @@ static gint compose_write_headers_from_headerlist(Compose *compose,
 
                if (!g_strcasecmp(trans_hdr, headerentryname)) {
                        const gchar *entstr = gtk_entry_get_text(GTK_ENTRY(headerentry->entry));
-                       gchar *tmpstr = conv_codeset_strdup(entstr, CS_UTF_8, conv_get_current_charset_str());
-                       Xstrdup_a(str, tmpstr, return -1);
+                       Xstrdup_a(str, entstr, return -1);
                        g_strstrip(str);
                        if (str[0] != '\0') {
                                if (write_header)
@@ -4353,7 +4354,6 @@ static gint compose_write_headers_from_headerlist(Compose *compose,
                                g_string_append(headerstr, str);
                                write_header = TRUE;
                        }
-                       g_free(tmpstr);
                }
        }
        if (write_header) {
@@ -6726,11 +6726,10 @@ static void compose_insert_file_cb(gpointer data, guint action,
                for ( tmp = file_list; tmp; tmp = tmp->next) {
                        gchar *file = (gchar *) tmp->data;
                        gchar *filedup = g_strdup(file);
-                       gchar *shortfile;
+                       const gchar *shortfile = g_basename(filedup);
                        ComposeInsertResult res;
 
                        res = compose_insert_file(compose, file);
-                       shortfile = g_basename(filedup);
                        if (res == COMPOSE_INSERT_READ_ERROR) {
                                alertpanel_error(_("File '%s' could not be read."), shortfile);
                        } else if (res == COMPOSE_INSERT_INVALID_CHARACTER) {