sync with sylpheed 0.6.2cvs9
authorPaul Mangan <paul@claws-mail.org>
Tue, 2 Oct 2001 08:34:49 +0000 (08:34 +0000)
committerPaul Mangan <paul@claws-mail.org>
Tue, 2 Oct 2001 08:34:49 +0000 (08:34 +0000)
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
src/addressbook.c
src/codeconv.c
src/codeconv.h
src/compose.c
src/stringtable.c
src/summaryview.c
src/summaryview.h

index 8f0777d..61807ac 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2001-10-02
+
+       * src/summaryview.[ch]: implemented new locking mechanism, and
+         replaced every static locks with summary_lock(), summary_unlock(),
+         and added locks to some extra functions.
+         This fixes a bug that caused segfault when 'd' (delete) key
+         was kept pressing.
+
+2001-10-01
+
+       * src/addressbook.c: addressbook_folder_load_person(): fixed a bug
+         that caused segfault (thanks to Stefaan A Eeckels).
+
 2001-09-30
 
        * src/textview.[ch]: added textview_set_position().
          imap_status(), imap_cmd_login(), imap_cmd_list(),
          imap_cmd_do_select(), imap_cmd_create(), imap_cmd_delete(),
          imap_cmd_copy(): use QUOTE_IF_REQUIRED().
+       * compose.c: compose_write_to_file(): workaround for the problem
+         when using libjconv and 8bit codes cannot be converted on C
+         locale.
+       * codeconv.[ch]: added "ANSI_X3.4-1968" to encoding strings.
+         conv_codeset_strdup(): don't convert if source and destination
+         codeset are identical.
 
 2001-09-30
 
index ab683fc..8d07b48 100644 (file)
@@ -1,3 +1,7 @@
+2001-10-02 [paul]      0.6.2claws13
+
+       * sync with sylpheed 0.6.2cvs9
+
 2001-09-30 [paul]      0.6.2claws12
 
        * po/de.po, po/es.po, po/fr.po, po/nl.po, po/pt_BR.po
index ef43977..c3ce6a6 100644 (file)
@@ -1,3 +1,16 @@
+2001-10-02
+
+       * src/summaryview.[ch]: ¿·¤¿¤Ê¥í¥Ã¥¯µ¡¹½¤ò¼ÂÁõ¤·¡¢Á´¤Æ¤ÎÀÅŪ¤Ê
+         ¥í¥Ã¥¯¤ò summary_lock(), summary_unlock() ¤ÇÃÖ¤­´¹¤¨¡¢¤¤¤¯¤Ä¤«
+         ¤Î´Ø¿ô¤Ë¤µ¤é¤Ë¥í¥Ã¥¯¤òÄɲä·¤¿¡£
+         ¤³¤ì¤Ë¤è¤ê 'd' (ºï½ü) ¥­¡¼¤ò²¡¤·¤Ã¤Ñ¤Ê¤·¤Ë¤·¤¿¤È¤­¤Ë segfault ¤ò
+         µ¯¤³¤¹¥Ð¥°¤ò½¤Àµ¡£
+
+2001-10-01
+
+       * src/addressbook.c: addressbook_folder_load_person(): segfault ¤ò
+         µ¯¤³¤¹¥Ð¥°¤ò½¤Àµ(Stefaan A Eeckels ¤µ¤ó thanks)¡£
+
 2001-09-30
 
        * src/textview.[ch]: textview_set_position() ¤òÄɲá£
          imap_status(), imap_cmd_login(), imap_cmd_list(),
          imap_cmd_do_select(), imap_cmd_create(), imap_cmd_delete(),
          imap_cmd_copy(): QUOTE_IF_REQUIRED() ¤ò»ÈÍÑ¡£
+       * compose.c: compose_write_to_file(): libjconv »ÈÍÑ»þ¤Ë C locale
+         ¤Ç 8bit ¥³¡¼¥É¤¬ÊÑ´¹¤Ç¤­¤Ê¤¤ÌäÂê¤ËÂн衣
+       * codeconv.[ch]: ¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°Ê¸»úÎó¤Ë "ANSI_X3.4-1968" ¤òÄɲá£
+         conv_codeset_strdup(): ÊÑ´¹¸µ¤ÈÊÑ´¹Àè¤Î¥³¡¼¥É¥»¥Ã¥È¤¬Æ±°ì¤Î
+         ¾ì¹ç¤ÏÊÑ´¹¤·¤Ê¤¤¤è¤¦¤Ë¤·¤¿¡£
 
 2001-09-30
 
index d582123..48d1005 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=6
 MICRO_VERSION=2
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws12
+EXTRA_VERSION=claws13
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl
index 7e0a7d3..62b9c89 100644 (file)
@@ -2009,7 +2009,7 @@ static void addressbook_folder_load_person( GtkCTree *clist, ItemFolder *itemFol
                        text[COL_ADDRESS] = email->address;
                        text[COL_REMARKS] = email->remarks;
                        eMailAddr = ADDRITEM_NAME(email);
-                       if( *eMailAddr == '\0' ) eMailAddr = NULL;
+                       if( eMailAddr && *eMailAddr == '\0' ) eMailAddr = NULL;
                        if( flgFirst ) {
                                /* First email belongs with person */
                                gchar *str = addressbook_format_item_clist( person, email );
index ca69e59..9061b60 100644 (file)
@@ -351,6 +351,11 @@ gchar *conv_codeset_strdup(const gchar *inbuf,
                }
        }
 
+       /* don't convert if src and dest codeset are identical */
+       if (src_codeset && dest_codeset &&
+           !strcasecmp(src_codeset, dest_codeset))
+               return g_strdup(inbuf);
+
 #if HAVE_LIBJCONV
        if (src_codeset) {
                codesets = &src_codeset;
@@ -439,6 +444,7 @@ static const struct {
        gchar *const name;
 } charsets[] = {
        {C_US_ASCII,            CS_US_ASCII},
+       {C_US_ASCII,            CS_ANSI_X3_4_1968},
        {C_UTF_8,               CS_UTF_8},
        {C_ISO_8859_1,          CS_ISO_8859_1},
        {C_ISO_8859_2,          CS_ISO_8859_2},
@@ -619,16 +625,12 @@ CharSet conv_get_current_charset(void)
 
 const gchar *conv_get_current_charset_str(void)
 {
-#if HAVE_LIBJCONV
-       return jconv_info_get_current_codeset();
-#else
        static const gchar *codeset = NULL;
 
        if (!codeset)
                codeset = conv_get_charset_str(conv_get_current_charset());
 
        return codeset ? codeset : "US-ASCII";
-#endif
 }
 
 CharSet conv_get_outgoing_charset(void)
index c44a4cb..5ff3dcc 100644 (file)
@@ -77,6 +77,7 @@ struct _CodeConverter
 
 #define CS_AUTO                        "AUTO"
 #define CS_US_ASCII            "US-ASCII"
+#define CS_ANSI_X3_4_1968      "ANSI_X3.4-1968"
 #define CS_UTF_8               "UTF-8"
 #define CS_ISO_8859_1          "ISO-8859-1"
 #define CS_ISO_8859_2          "ISO-8859-2"
index c861386..26ae9ed 100644 (file)
@@ -2421,10 +2421,12 @@ static gint compose_write_to_file(Compose *compose, const gchar *file,
                if (!strcasecmp(out_codeset, "US-ASCII"))
                        out_codeset = "ISO-8859-1";
                encoding = procmime_get_encoding_for_charset(out_codeset);
-               debug_print("charset = %s, encoding = %s\n",
-                           out_codeset, procmime_get_encoding_str(encoding));
-
                src_codeset = conv_get_current_charset_str();
+               if (!strcasecmp(src_codeset, "US-ASCII"))
+                       src_codeset = "ISO-8859-1";
+               debug_print("src encoding = %s, out encoding = %s, transfer encoding = %s\n",
+                           src_codeset, out_codeset, procmime_get_encoding_str(encoding));
+
                buf = conv_codeset_strdup(chars, src_codeset, out_codeset);
                if (!buf) {
                        g_free(chars);
index 0317602..9015953 100644 (file)
 /* alfons - hashed string table (I wasn't content with GStringChunk; 
  * can't recall why :-) */
 
+#if 0
 #define XXX_DEBUG \
-       debug_print  
+       debug_print
+#else
+#define XXX_DEBUG \
+       if (0) debug_print
+#endif
+
 typedef struct StringEntry_ {
        gint    ref_count;
        gchar  *string;
index deb805b..01c44a0 100644 (file)
@@ -277,6 +277,9 @@ static void summary_col_resized             (GtkCList               *clist,
 static void summary_reply_cb           (SummaryView            *summaryview,
                                         guint                   action,
                                         GtkWidget              *widget);
+static void summary_execute_cb         (SummaryView            *summaryview,
+                                        guint                   action,
+                                        GtkWidget              *widget);
 static void summary_show_all_header_cb (SummaryView            *summaryview,
                                         guint                   action,
                                         GtkWidget              *widget);
@@ -372,7 +375,7 @@ static GtkItemFactoryEntry summary_popup_entries[] =
        {N_("/M_ove..."),               NULL, summary_move_to,  0, NULL},
        {N_("/_Copy..."),               NULL, summary_copy_to,  0, NULL},
        {N_("/_Delete"),                NULL, summary_delete,   0, NULL},
-       {N_("/E_xecute"),               NULL, summary_execute,  0, NULL},
+       {N_("/E_xecute"),               NULL, summary_execute_cb,       0, NULL},
        {N_("/---"),                    NULL, NULL,             0, "<Separator>"},
        {N_("/_Mark"),                  NULL, NULL,             0, "<Branch>"},
        {N_("/_Mark/_Mark"),            NULL, summary_mark,     0, NULL},
@@ -386,8 +389,8 @@ static GtkItemFactoryEntry summary_popup_entries[] =
        {N_("/Color la_bel"),           NULL, NULL,             0, NULL},
 
        {N_("/---"),                    NULL, NULL,             0, "<Separator>"},
-       {N_("/Add sender to address _book"),
-                                       NULL, summary_add_address_cb,           0, NULL},
+       {N_("/Add sender to address boo_k"),
+                                       NULL, summary_add_address_cb, 0, NULL},
        {N_("/---"),                    NULL, NULL,             0, "<Separator>"},
        {N_("/_View"),                  NULL, NULL,             0, "<Branch>"},
        {N_("/_View/Open in new _window"),
@@ -591,6 +594,7 @@ SummaryView *summary_create(void)
        summaryview->popupmenu = popupmenu;
        summaryview->popupfactory = popupfactory;
        summaryview->msg_is_toggled_on = TRUE;
+       summaryview->lock_count = 0;
        summaryview->sort_mode = SORT_BY_NONE;
        summaryview->sort_type = GTK_SORT_ASCENDING;
 
@@ -749,11 +753,10 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item,
        gint sort_type;
         static gboolean locked = FALSE;
 
-       if (locked)
-               return FALSE;
+       if (summary_is_locked(summaryview)) return FALSE;
 
        inc_lock();
-       locked = TRUE;
+       summary_lock(summaryview);
 
        STATUSBAR_POP(summaryview->mainwin);
 
@@ -780,9 +783,9 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item,
                else if (G_ALERTALTERNATE == val)
                        summary_write_cache(summaryview);
                else {
-                       locked = FALSE;
+                       summary_unlock(summaryview);
                        inc_unlock();
-                        return FALSE;
+                       return FALSE;
                }
                folder_update_op_count();
        }
@@ -813,7 +816,7 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item,
                summary_clear_all(summaryview);
                summaryview->folder_item = item;
                gtk_clist_thaw(GTK_CLIST(ctree));
-               locked = FALSE;
+               summary_unlock(summaryview);
                inc_unlock();
                return TRUE;
        }
@@ -935,7 +938,7 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item,
        STATUSBAR_PUSH(summaryview->mainwin, _("Done."));
 
        main_window_cursor_normal(summaryview->mainwin);
-       locked = FALSE;
+       summary_unlock(summaryview);
        inc_unlock();
 
        return TRUE;
@@ -1002,6 +1005,22 @@ void summary_clear_all(SummaryView *summaryview)
        summary_status_show(summaryview);
 }
 
+void summary_lock(SummaryView *summaryview)
+{
+       summaryview->lock_count++;
+}
+
+void summary_unlock(SummaryView *summaryview)
+{
+       if (summaryview->lock_count)
+               summaryview->lock_count--;
+}
+
+gboolean summary_is_locked(SummaryView *summaryview)
+{
+       return summaryview->lock_count > 0;
+}
+
 SummarySelection summary_get_selection_type(SummaryView *summaryview)
 {
        GtkCList *clist = GTK_CLIST(summaryview->ctree);
@@ -2184,13 +2203,12 @@ static void summary_display_msg(SummaryView *summaryview, GtkCTreeNode *row,
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
        MsgInfo *msginfo;
        gchar *filename;
-       static gboolean lock = FALSE;
 
        if (!new_window && summaryview->displayed == row) return;
        g_return_if_fail(row != NULL);
 
-       if (lock) return;
-       lock = TRUE;
+       if (summary_is_locked(summaryview)) return;
+       summary_lock(summaryview);
 
        STATUSBAR_POP(summaryview->mainwin);
        GTK_EVENTS_FLUSH();
@@ -2199,7 +2217,7 @@ static void summary_display_msg(SummaryView *summaryview, GtkCTreeNode *row,
 
        filename = procmsg_get_message_file(msginfo);
        if (!filename) {
-               lock = FALSE;
+               summary_unlock(summaryview);
                return;
        }
        g_free(filename);
@@ -2241,7 +2259,7 @@ static void summary_display_msg(SummaryView *summaryview, GtkCTreeNode *row,
        if (GTK_WIDGET_VISIBLE(summaryview->headerwin->window))
                header_window_show(summaryview->headerwin, msginfo);
 
-       lock = FALSE;
+       summary_unlock(summaryview);
 }
 
 void summary_redisplay_msg(SummaryView *summaryview)
@@ -2676,6 +2694,8 @@ void summary_delete(SummaryView *summaryview)
        if (!summaryview->folder_item ||
            summaryview->folder_item->folder->type == F_NEWS) return;
 
+       if (summary_is_locked(summaryview)) return;
+
        /* if current folder is trash, don't delete */
        if (summaryview->folder_item->stype == F_TRASH) {
                alertpanel_notice(_("Current folder is Trash."));
@@ -2830,6 +2850,9 @@ void summary_move_selected_to(SummaryView *summaryview, FolderItem *to_folder)
        if (!to_folder) return;
        if (!summaryview->folder_item ||
            summaryview->folder_item->folder->type == F_NEWS) return;
+
+       if (summary_is_locked(summaryview)) return;
+
        if (summaryview->folder_item == to_folder) {
                alertpanel_notice(_("Destination is same as current folder."));
                return;
@@ -2916,6 +2939,9 @@ void summary_copy_selected_to(SummaryView *summaryview, FolderItem *to_folder)
        if (!to_folder) return;
        if (!summaryview->folder_item ||
            summaryview->folder_item->folder->type == F_NEWS) return;
+
+       if (summary_is_locked(summaryview)) return;
+
        if (summaryview->folder_item == to_folder) {
                alertpanel_notice
                        (_("Destination to copy is same as current folder."));
@@ -3044,14 +3070,17 @@ void summary_print(SummaryView *summaryview)
        g_free(cmdline);
 }
 
-void summary_execute(SummaryView *summaryview)
+gboolean summary_execute(SummaryView *summaryview)
 {
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
        GtkCList *clist = GTK_CLIST(summaryview->ctree);
        GtkCTreeNode *node, *next;
 
        if (!summaryview->folder_item ||
-           summaryview->folder_item->folder->type == F_NEWS) return;
+           summaryview->folder_item->folder->type == F_NEWS) return FALSE;
+
+       if (summary_is_locked(summaryview)) return FALSE;
+       summary_lock(summaryview);
 
        gtk_clist_freeze(clist);
 
@@ -3099,6 +3128,9 @@ void summary_execute(SummaryView *summaryview)
        gtk_ctree_node_moveto(ctree, summaryview->selected, -1, 0.5, 0);
 
        gtk_clist_thaw(clist);
+
+       summary_unlock(summaryview);
+       return TRUE;
 }
 
 static void summary_execute_move(SummaryView *summaryview)
@@ -3269,6 +3301,8 @@ void summary_thread_build(SummaryView *summaryview, gboolean init)
        GtkCTreeNode *parent;
        MsgInfo *msginfo;
 
+       summary_lock(summaryview);
+
        debug_print(_("Building threads..."));
        STATUSBAR_PUSH(summaryview->mainwin, _("Building threads..."));
        main_window_cursor_wait(summaryview->mainwin);
@@ -3345,6 +3379,8 @@ void summary_thread_build(SummaryView *summaryview, gboolean init)
        debug_print(_("done.\n"));
        STATUSBAR_POP(summaryview->mainwin);
        main_window_cursor_normal(summaryview->mainwin);
+
+       summary_unlock(summaryview);
 }
 
 void summary_unthread(SummaryView *summaryview)
@@ -3355,6 +3391,8 @@ void summary_unthread(SummaryView *summaryview)
        GtkCTreeNode *sibling;
        GtkCTreeNode *next_child;
 
+       summary_lock(summaryview);
+
        debug_print(_("Unthreading..."));
        STATUSBAR_PUSH(summaryview->mainwin, _("Unthreading..."));
        main_window_cursor_wait(summaryview->mainwin);
@@ -3382,6 +3420,8 @@ void summary_unthread(SummaryView *summaryview)
        debug_print(_("done.\n"));
        STATUSBAR_POP(summaryview->mainwin);
        main_window_cursor_normal(summaryview->mainwin);
+
+       summary_unlock(summaryview);
 }
 
 static void summary_unthread_for_exec(SummaryView *summaryview)
@@ -3389,6 +3429,8 @@ static void summary_unthread_for_exec(SummaryView *summaryview)
        GtkCTreeNode *node;
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
 
+       summary_lock(summaryview);
+
        debug_print(_("Unthreading for execution..."));
 
        gtk_clist_freeze(GTK_CLIST(ctree));
@@ -3401,6 +3443,8 @@ static void summary_unthread_for_exec(SummaryView *summaryview)
        gtk_clist_thaw(GTK_CLIST(ctree));
 
        debug_print(_("done.\n"));
+
+       summary_unlock(summaryview);
 }
 
 static void summary_unthread_for_exec_func(GtkCTree *ctree, GtkCTreeNode *node,
@@ -3439,6 +3483,8 @@ void summary_filter(SummaryView *summaryview)
 {
        if (!prefs_common.fltlist) return;
 
+       summary_lock(summaryview);
+
        debug_print(_("filtering..."));
        STATUSBAR_PUSH(summaryview->mainwin, _("Filtering..."));
        main_window_cursor_wait(summaryview->mainwin);
@@ -3478,6 +3524,8 @@ void summary_filter(SummaryView *summaryview)
        debug_print(_("done.\n"));
        STATUSBAR_POP(summaryview->mainwin);
        main_window_cursor_normal(summaryview->mainwin);
+
+       summary_unlock(summaryview);
 }
 
 static void summary_filter_func(GtkCTree *ctree, GtkCTreeNode *node,
@@ -3650,7 +3698,6 @@ static void summary_colorlabel_menu_create(SummaryView *summaryview)
        gtk_signal_connect(GTK_OBJECT(label_menuitem), "activate",
                           GTK_SIGNAL_FUNC(summary_colorlabel_menu_item_activate_item_cb),
                           summaryview);
-
        gtk_widget_show(label_menuitem);
 
        menu = gtk_menu_new();
@@ -4101,6 +4148,12 @@ static void summary_reply_cb(SummaryView *summaryview, guint action,
        summary_set_marks_selected(summaryview);
 }
 
+static void summary_execute_cb(SummaryView *summaryview, guint action,
+                              GtkWidget *widget)
+{
+       summary_execute(summaryview);
+}
+
 static void summary_show_all_header_cb(SummaryView *summaryview,
                                       guint action, GtkWidget *widget)
 {
index b55ac20..86a89d6 100644 (file)
@@ -111,6 +111,8 @@ struct _SummaryView
        GdkColor color_marked;
        GdkColor color_dim;
 
+       guint lock_count;
+
        MainWindow   *mainwin;
        FolderView   *folderview;
        HeaderView   *headerview;
@@ -161,6 +163,10 @@ gboolean summary_show                (SummaryView          *summaryview,
 void summary_clear_list                  (SummaryView          *summaryview);
 void summary_clear_all           (SummaryView          *summaryview);
 
+void summary_lock                (SummaryView          *summaryview);
+void summary_unlock              (SummaryView          *summaryview);
+gboolean summary_is_locked       (SummaryView          *summaryview);
+
 SummarySelection summary_get_selection_type    (SummaryView    *summaryview);
 
 void summary_select_prev_unread          (SummaryView          *summaryview);
@@ -184,7 +190,7 @@ void summary_sort             (SummaryView          *summaryview,
 
 void summary_delete              (SummaryView          *summaryview);
 void summary_delete_duplicated   (SummaryView          *summaryview);
-void summary_execute             (SummaryView          *summaryview);
+gboolean summary_execute         (SummaryView          *summaryview);
 void summary_attract_by_subject          (SummaryView          *summaryview);
 gint summary_write_cache         (SummaryView          *summaryview);
 void summary_pass_key_press_event (SummaryView         *summaryview,