sync with 0.9.5cvs8
authorPaul Mangan <paul@claws-mail.org>
Wed, 17 Sep 2003 07:52:30 +0000 (07:52 +0000)
committerPaul Mangan <paul@claws-mail.org>
Wed, 17 Sep 2003 07:52:30 +0000 (07:52 +0000)
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.ac
src/addressbook.c
src/folderview.c
src/grouplistdialog.c
src/headerview.c
src/imap.c
src/recv.c
src/summaryview.c

index 2d599ff..cf8b491 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2003-09-17
+
+       * src/addressbook.c:
+         addressbook_folder_load_person()
+         addressbook_folder_load_group(): sort the ctree after the end of
+         the loop (fixes performance issue when many addresses are in one
+         folder) (thanks to christian mock).
+
+2003-09-16
+
+       * src/folderview.c: folder_init(): code cleanup.
+       * src/summaryview.c: summary_init(): check if boldfont is
+         successfully loaded.
+       * src/grouplistdialog.c: use proper callback for delete_event (thanks
+         to Takuro Ashie).
+       * src/imap.c: allow zero-length messages.
+       * src/recv.c: recv_bytes_write(): return immediately if size == 0.
+
 2003-09-16
 
        * src/folderview.c: folderview_init(): if font can't be loaded, fall
index ea789ef..2cbc072 100644 (file)
@@ -1,3 +1,8 @@
+2003-09-17 [paul]      0.9.5claws17
+
+       * sync with 0.9.5cvs8
+               see ChangeLog 2003-09-16 and 2003-09-17
+
 2003-09-16 [paul]      0.9.5claws16
 
        * sync with 0.9.5cvs6
index 3c303e4..ff0b695 100644 (file)
@@ -1,3 +1,22 @@
+2003-09-17
+
+       * src/addressbook.c:
+         addressbook_folder_load_person()
+         addressbook_folder_load_group(): ¥ë¡¼¥×¤Î¸å¤Ç ctree ¤ò¥½¡¼¥È¤¹¤ë
+         ¤è¤¦¤Ë¤·¤¿(°ì¤Ä¤Î¥Õ¥©¥ë¥À¤Ë¿¤¯¤Î¥¢¥É¥ì¥¹¤¬¤¢¤ë¾ì¹ç¤Î¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹
+         ¤ÎÌäÂê¤ò²ò·è)(christian mock ¤µ¤ó thanks)¡£
+
+2003-09-16
+
+       * src/folderview.c: folder_init(): ¥³¡¼¥É¤òÀ°Íý¡£
+       * src/summaryview.c: summary_init(): boldfont ¤¬Àµ¤·¤¯¥í¡¼¥É¤µ¤ì¤¿¤«
+         ¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¡£
+       * src/grouplistdialog.c: delete_event ¤ËŬÀڤʥ³¡¼¥ë¥Ð¥Ã¥¯¤ò»ÈÍѤ¹¤ë
+         ¤è¤¦¤Ë¤·¤¿(­±Ê¤µ¤ó thanks)¡£
+       * src/imap.c: ¥¼¥íĹ¥á¥Ã¥»¡¼¥¸¤òµö¤¹¤è¤¦¤Ë¤·¤¿¡£
+       * src/recv.c: recv_bytes_write(): size == 0 ¤Î¾ì¹ç¤Ï¤¹¤°¤ËÌá¤ë¤è¤¦¤Ë
+         ¤·¤¿¡£
+
 2003-09-16
 
        * src/folderview.c: folderview_init(): ¥Õ¥©¥ó¥È¤¬Æɤ߹þ¤á¤Ê¤¤¾ì¹ç¤Ï
index 5cf5969..5f1b36e 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=16
+EXTRA_VERSION=17
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
index 6daf690..7616785 100644 (file)
@@ -2669,8 +2669,9 @@ static void addressbook_folder_load_group( GtkCTree *clist, ItemFolder *itemFold
                                      atci->iconXpmOpen, atci->maskXpmOpen,
                                      FALSE, FALSE);
                gtk_ctree_node_set_row_data(clist, nodeGroup, group );
-               gtk_sctree_sort_node(clist, NULL);
        }
+       gtk_sctree_sort_node(clist, NULL);
+
        /* Free up the list */
        mgu_clear_list( items );
        g_list_free( items );
index 1148630..248493f 100644 (file)
@@ -587,36 +587,22 @@ void folderview_init(FolderView *folderview)
        gtk_clist_set_column_widget(GTK_CLIST(ctree),COL_NEW,hbox_new);
        gtk_clist_set_column_widget(GTK_CLIST(ctree),COL_UNREAD,hbox_unread);
                        
-       if (!normalfont) {
-               normalfont = gtkut_font_load(prefs_common.normalfont);
-               if (!normalfont) {
-                       GtkStyle *style;
-                       style = gtk_widget_get_style(ctree);
-                       normalfont = style->font;
-                       gdk_font_ref(normalfont);
-               } 
-       }
-       
        if (!normal_style) {
                normal_style = gtk_style_copy(gtk_widget_get_style(ctree));
-               normal_style->font = normalfont;
+               if (!normalfont)
+                       normalfont = gtkut_font_load(prefs_common.normalfont);
+               if (normalfont)
+                       normal_style->font = normalfont;
                normal_color_style = gtk_style_copy(normal_style);
                normal_color_style->fg[GTK_STATE_NORMAL] = folderview->color_new;
        }
 
-       if (!boldfont) {
-               boldfont = gtkut_font_load(prefs_common.boldfont);
-               if (!boldfont) {
-                       GtkStyle *style;
-                       style = gtk_widget_get_style(ctree);
-                       boldfont = style->font;
-                       gdk_font_ref(boldfont);
-               }
-       }
-
        if (!bold_style) {
                bold_style = gtk_style_copy(gtk_widget_get_style(ctree));
-               bold_style->font = boldfont;
+               if (!boldfont)
+                       boldfont = gtkut_font_load(prefs_common.boldfont);
+               if (boldfont)
+                       bold_style->font = boldfont;
                bold_color_style = gtk_style_copy(bold_style);
                bold_color_style->fg[GTK_STATE_NORMAL] = folderview->color_new;
 
index c06a243..6f0b297 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2002 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2003 Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -79,6 +79,9 @@ static gboolean grouplist_recv_func   (SockInfo       *sock,
                                         gint            read_bytes,
                                         gpointer        data);
 
+static gint window_deleted     (GtkWidget      *widget,
+                                GdkEventAny    *event,
+                                gpointer        data);
 static void ok_clicked         (GtkWidget      *widget,
                                 gpointer        data);
 static void cancel_clicked     (GtkWidget      *widget,
@@ -172,7 +175,7 @@ static void grouplist_dialog_create(void)
        gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER);
        gtk_window_set_title(GTK_WINDOW(dialog), _("Newsgroup subscription"));
        gtk_signal_connect(GTK_OBJECT(dialog), "delete_event",
-                          GTK_SIGNAL_FUNC(cancel_clicked), NULL);
+                          GTK_SIGNAL_FUNC(window_deleted), NULL);
        gtk_signal_connect(GTK_OBJECT(dialog), "key_press_event",
                           GTK_SIGNAL_FUNC(key_pressed), NULL);
        MANAGE_WINDOW_SIGNALS_CONNECT(dialog);
@@ -484,6 +487,15 @@ static gboolean grouplist_recv_func(SockInfo *sock, gint count, gint read_bytes,
                return TRUE;
 }
 
+static gint window_deleted(GtkWidget *widget, GdkEventAny *event, gpointer data)
+{
+       ack = FALSE;
+       if (gtk_main_level() > 1)
+               gtk_main_quit();
+
+       return TRUE;
+}
+
 static void ok_clicked(GtkWidget *widget, gpointer data)
 {
        ack = TRUE;
index e98c748..c4e4d12 100644 (file)
@@ -46,8 +46,6 @@
 #include "gtkutils.h"
 #include "utils.h"
 
-static GdkFont *boldfont;
-
 #define TR(str)        (prefs_common.trans_hdr ? gettext(str) : str)
 
 #if 0
@@ -133,6 +131,8 @@ HeaderView *headerview_create(void)
 
 void headerview_init(HeaderView *headerview)
 {
+       static GdkFont *boldfont = NULL;
+
        if (!boldfont)
                boldfont = gtkut_font_load(BOLD_FONT);
 
index be3fc8a..01cd4d1 100644 (file)
@@ -2147,7 +2147,7 @@ static gchar *imap_parse_atom(SockInfo *sock, gchar *src,
 
                cur_pos = strchr_cpy(cur_pos + 1, '}', buf, sizeof(buf));
                len = atoi(buf);
-               g_return_val_if_fail(len > 0, cur_pos);
+               g_return_val_if_fail(len >= 0, cur_pos);
 
                g_string_truncate(str, 0);
                cur_pos = str->str;
@@ -2190,7 +2190,7 @@ static gchar *imap_get_header(SockInfo *sock, gchar *cur_pos, gchar **headers,
 
        cur_pos = strchr_cpy(cur_pos + 1, '}', buf, sizeof(buf));
        len = atoi(buf);
-       g_return_val_if_fail(len > 0, cur_pos);
+       g_return_val_if_fail(len >= 0, cur_pos);
 
        g_string_truncate(str, 0);
        cur_pos = str->str;
@@ -2841,7 +2841,7 @@ static gint imap_cmd_fetch(IMAPSession *session, guint32 uid, const gchar *filen
        cur_pos = strchr_cpy(cur_pos + 1, '}', size_str, sizeof(size_str));
        RETURN_ERROR_IF_FAIL(cur_pos != NULL);
        size_num = atol(size_str);
-       RETURN_ERROR_IF_FAIL(size_num > 0);
+       RETURN_ERROR_IF_FAIL(size_num >= 0);
 
        RETURN_ERROR_IF_FAIL(*cur_pos == '\0');
 
index ff135a2..3c4597b 100644 (file)
@@ -41,7 +41,7 @@ gint recv_write_to_file(SockInfo *sock, const gchar *filename)
 {
        FILE *fp;
        gint ret;
-       
+
        g_return_val_if_fail(filename != NULL, -1);
 
        if ((fp = fopen(filename, "wb")) == NULL) {
@@ -169,6 +169,9 @@ gint recv_bytes_write(SockInfo *sock, glong size, FILE *fp)
        glong count = 0;
        gchar *prev, *cur;
 
+       if (size == 0)
+               return 0;
+
        buf = g_malloc(size);
 
        do {
index 2208266..ac2fbda 100644 (file)
@@ -91,8 +91,6 @@
 #define SUMMARY_COL_LOCKED_WIDTH       13
 #define SUMMARY_COL_MIME_WIDTH         11
 
-static GdkFont *boldfont;
-static GdkFont *smallfont;
 
 static GtkStyle *bold_style;
 static GtkStyle *bold_marked_style;
@@ -722,6 +720,8 @@ SummaryView *summary_create(void)
 
 void summary_init(SummaryView *summaryview)
 {
+       static GdkFont *boldfont = NULL;
+       static GdkFont *smallfont = NULL;
        GtkStyle *style;
        GtkWidget *pixmap;
 
@@ -751,6 +751,21 @@ void summary_init(SummaryView *summaryview)
        stock_pixmap_gdk(summaryview->ctree, STOCK_PIXMAP_GPG_SIGNED,
                         &gpgsignedxpm, &gpgsignedxpmmask);
 
+       if (!bold_style) {
+               bold_style = gtk_style_copy
+                       (gtk_widget_get_style(summaryview->ctree));
+               if (!boldfont)
+                       boldfont = gtkut_font_load(BOLD_FONT);
+               if (boldfont)
+                       bold_style->font = boldfont;
+               bold_marked_style = gtk_style_copy(bold_style);
+               bold_marked_style->fg[GTK_STATE_NORMAL] =
+                       summaryview->color_marked;
+               bold_deleted_style = gtk_style_copy(bold_style);
+               bold_deleted_style->fg[GTK_STATE_NORMAL] =
+                       summaryview->color_dim;
+       }
+       
        if (!small_style) {
                small_style = gtk_style_copy
                        (gtk_widget_get_style(summaryview->ctree));
@@ -764,23 +779,11 @@ void summary_init(SummaryView *summaryview)
                small_deleted_style->fg[GTK_STATE_NORMAL] =
                        summaryview->color_dim;
        }
-       if (!bold_style) {
-               bold_style = gtk_style_copy
-                       (gtk_widget_get_style(summaryview->ctree));
-               if (!boldfont)
-                       boldfont = gtkut_font_load(BOLD_FONT);
-               bold_style->font = boldfont;
-               bold_marked_style = gtk_style_copy(bold_style);
-               bold_marked_style->fg[GTK_STATE_NORMAL] =
-                       summaryview->color_marked;
-               bold_deleted_style = gtk_style_copy(bold_style);
-               bold_deleted_style->fg[GTK_STATE_NORMAL] =
-                       summaryview->color_dim;
-       }
 
        style = gtk_style_copy(gtk_widget_get_style
                                (summaryview->statlabel_folder));
-
+       if (smallfont)
+               style->font = smallfont;
        gtk_widget_set_style(summaryview->statlabel_folder, style);
        gtk_widget_set_style(summaryview->statlabel_select, style);
        gtk_widget_set_style(summaryview->statlabel_msgs, style);