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 fd10dc0..345db4a 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 e1332f3..b6661a3 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 0e660d5..5326187 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 f3c7345..ffd791d 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 3d7fd9e..67ca371 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);