sync with 0.8.10cvs6
authorPaul Mangan <paul@claws-mail.org>
Fri, 7 Feb 2003 07:52:54 +0000 (07:52 +0000)
committerPaul Mangan <paul@claws-mail.org>
Fri, 7 Feb 2003 07:52:54 +0000 (07:52 +0000)
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.ac
src/codeconv.c

index fd10dc03ab2c3216bef45aeaa336ab5c5b4527d1..345db4af14e4c45cbd1f5ea4c287da2a83e6358c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2003-02-07
+
+       * src/filter.c: filter_match_condition(): fixed the bug that
+         second condition ignored regex.
+       * src/news.h: NewsGroupInfo: use guint for message numbers
+         (fix count in grouplist dialog) (thanks to Thorsten Maerz).
+
+2003-02-06
+
+       * src/codeconv.c: conv_encode_header(): fixed a segfault bug
+         on code conversion failure.
+         conv_get_charset_str()
+         conv_get_charset_from_str(): optimized using hash table.
+
+2003-02-06
+
+       * src/quote_fmt_parse.y:
+         SHOW_MESSAGE_NO_SIGNATURE, SHOW_QUOTED_MESSAGE_NO_SIGNATURE:
+         treat only "\n-- \n" as a signature separator.
+
 2003-02-05
 
        * src/gtkutils.[ch]: gtkut_ctree_node_prev(): new.
index e1332f3448021553d73d4ffc9c115fee312fccb1..b6661a38da788ff5559c5786cc841693b17a75b4 100644 (file)
@@ -1,3 +1,8 @@
+2003-02-07 [paul]      0.8.9claws46
+
+       * sync with 0.8.10cvs6
+               see ChangeLog 2003-02-06
+
 2003-02-06 [christoph] 0.8.9claws45
 
        * src/mbox.c
index 0e660d5f0c6b62d805382692c18080729d713e61..5326187949d0d5b0e9503782765d0fd0b71bfc68 100644 (file)
@@ -1,3 +1,24 @@
+2003-02-07
+
+       * src/filter.c: filter_match_condition(): 2ÈÖÌܤξò·ï¤¬Àµµ¬É½¸½¤ò
+         Ìµ»ë¤·¤Æ¤¤¤¿¥Ð¥°¤ò½¤Àµ¡£
+       * src/news.h: NewsGroupInfo: ¥á¥Ã¥»¡¼¥¸ÈÖ¹æ¤Ë guint ¤ò»ÈÍÑ
+         (¥°¥ë¡¼¥×¥ê¥¹¥È¥À¥¤¥¢¥í¥°¤Î¥á¥Ã¥»¡¼¥¸¿ô¤ò½¤Àµ) (Thorsten Maerz
+         ¤µ¤ó thanks)¡£
+
+2003-02-06
+
+       * src/codeconv.c: conv_encode_header(): ¥³¡¼¥ÉÊÑ´¹¼ºÇÔ»þ¤Ë segfault
+         ¤òµ¯¤³¤¹¥Ð¥°¤ò½¤Àµ¡£
+         conv_get_charset_str()
+         conv_get_charset_from_str(): ¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤ò»ÈÍѤ·¤ÆºÇŬ²½¡£
+
+2003-02-06
+
+       * src/quote_fmt_parse.y:
+         SHOW_MESSAGE_NO_SIGNATURE, SHOW_QUOTED_MESSAGE_NO_SIGNATURE:
+         "\n-- \n" ¤Î¤ß¤ò½ð̾¤Î¶èÀÚ¤ê¤È¤·¤Æ°·¤¦¤è¤¦¤Ë¤·¤¿¡£
+
 2003-02-05
 
        * src/gtkutils.[ch]: gtkut_ctree_node_prev(): ¿·µ¬¡£
index f3c7345bdd3b1c0d74447478cd0b89c4bca4b252..ffd791d750917003899d8e6ce4586d208200b607 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=9
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws45
+EXTRA_VERSION=claws46
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 3d7fd9eec0c419f51ccb11f0723f0cfd9b33c122..67ca371a64f572a5bda58ee212bbeedee7c2e270 100644 (file)
@@ -960,30 +960,81 @@ static const struct {
        {"ANSI_X3.4-1968"       , C_US_ASCII    , C_US_ASCII},
 };
 
-const gchar *conv_get_charset_str(CharSet charset)
+static GHashTable *conv_get_charset_to_str_table(void)
 {
+       static GHashTable *table;
        gint i;
 
+       if (table)
+               return table;
+
+       table = g_hash_table_new(NULL, g_direct_equal);
+
        for (i = 0; i < sizeof(charsets) / sizeof(charsets[0]); i++) {
-               if (charsets[i].charset == charset)
-                       return charsets[i].name;
+               if (g_hash_table_lookup(table, GUINT_TO_POINTER(charsets[i].charset))
+                   == NULL) {
+                       g_hash_table_insert
+                               (table, GUINT_TO_POINTER(charsets[i].charset),
+                                charsets[i].name);
+               }
        }
 
-       return NULL;
+       return table;
 }
 
-CharSet conv_get_charset_from_str(const gchar *charset)
+static gint str_case_equal(gconstpointer v, gconstpointer v2)
+{
+       return strcasecmp((const gchar *)v, (const gchar *)v2) == 0;
+}
+
+static guint str_case_hash(gconstpointer key)
+{
+       const gchar *p = key;
+       guint h = *p;
+
+       if (h) {
+               h = tolower(h);
+               for (p += 1; *p != '\0'; p++)
+                       h = (h << 5) - h + tolower(*p);
+       }
+
+       return h;
+}
+
+static GHashTable *conv_get_charset_from_str_table(void)
 {
+       static GHashTable *table;
        gint i;
 
-       if (!charset) return C_AUTO;
+       if (table)
+               return table;
+
+       table = g_hash_table_new(str_case_hash, str_case_equal);
 
        for (i = 0; i < sizeof(charsets) / sizeof(charsets[0]); i++) {
-               if (!strcasecmp(charsets[i].name, charset))
-                       return charsets[i].charset;
+               g_hash_table_insert(table, charsets[i].name,
+                                   GUINT_TO_POINTER(charsets[i].charset));
        }
 
-       return C_AUTO;
+       return table;
+}
+
+const gchar *conv_get_charset_str(CharSet charset)
+{
+       GHashTable *table;
+
+       table = conv_get_charset_to_str_table();
+       return g_hash_table_lookup(table, GUINT_TO_POINTER(charset));
+}
+
+CharSet conv_get_charset_from_str(const gchar *charset)
+{
+       GHashTable *table;
+
+       if (!charset) return C_AUTO;
+
+       table = conv_get_charset_from_str_table();
+       return GPOINTER_TO_UINT(g_hash_table_lookup(table, charset));
 }
 
 CharSet conv_get_current_charset(void)
@@ -1282,7 +1333,8 @@ void conv_encode_header(gchar *dest, gint len, const gchar *src,
                                        (part_str, cur_encoding, out_encoding);
                                if (!out_str) {
                                        g_warning("conv_encode_header(): code conversion failed\n");
-                                       out_str = g_strdup(out_str);
+                                       conv_unreadable_8bit(part_str);
+                                       out_str = g_strdup(part_str);
                                }
                                out_str_len = strlen(out_str);
 
@@ -1312,7 +1364,8 @@ void conv_encode_header(gchar *dest, gint len, const gchar *src,
                                        (part_str, cur_encoding, out_encoding);
                                if (!out_str) {
                                        g_warning("conv_encode_header(): code conversion failed\n");
-                                       out_str = g_strdup(out_str);
+                                       conv_unreadable_8bit(part_str);
+                                       out_str = g_strdup(part_str);
                                }
                                out_str_len = strlen(out_str);