sync with sylpheed 0.4.67cvs9
authorAlfons Hoogervorst <alfons@proteus.demon.nl>
Thu, 17 May 2001 15:12:52 +0000 (15:12 +0000)
committerAlfons Hoogervorst <alfons@proteus.demon.nl>
Thu, 17 May 2001 15:12:52 +0000 (15:12 +0000)
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
src/folderview.c
src/gtkutils.c
src/gtkutils.h
src/main.c
src/socket.c
src/socket.h

index db3a8ee..3041164 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2001-05-17
+
+       * src/main.c: lock_socket_input_cb(): changed fd_read() to fd_gets().
+         It caused garbages in --compose option.
+       * src/socket.[ch]: made fd_gets() public.
+
+2001-05-16
+
+       * src/gtkutils.[ch]: gtkut_ctree_node_next(): new.
+       * src/folderview.c: folderview_find_next_unread(): new.
+         folderview_select_next_unread(): modified so that it can find
+         the hidden folder.
+
 2001-05-15
 
        * src/compose.c: compose_write_headers(): excluded also From, To,
index 2318f3e..0eeb514 100644 (file)
@@ -1,5 +1,8 @@
 2001-05-17 [alfons]
 
+       0.4.67claws4    
+
+       * sync with sylpheed 0.4.67cvs9
        * sync with sylpheed 0.4.67cvs7-8
 
 2001-05-17 [hoa]
index 64acea9..9c7cae0 100644 (file)
@@ -1,3 +1,16 @@
+2001-05-17
+
+       * src/main.c: lock_socket_input_cb(): fd_read() ¤ò fd_gets() ¤Ë
+         Êѹ¹¡£ --compose ¥ª¥×¥·¥ç¥ó¤Ç¥´¥ß¤òȯÀ¸¤·¤Æ¤¤¤¿¡£
+       * src/socket.[ch]: fd_gets() ¤ò public ¤Ë¤·¤¿¡£
+
+2001-05-16
+
+       * src/gtkutils.[ch]: gtkut_ctree_node_next(): ¿·µ¬¡£
+       * src/folderview.c: folderview_find_next_unread(): ¿·µ¬¡£
+         folderview_select_next_unread(): ±£¤ì¤¿¥Õ¥©¥ë¥À¤â¸«ÉÕ¤±¤é¤ì¤ë
+         ¤è¤¦¤Ë½¤Àµ¡£
+
 2001-05-15
 
        * src/compose.c: compose_write_headers(): SPAM ¤Ë»ÈÍѤµ¤ì¤ë²ÄǽÀ­
index ee6e4d8..fd3803b 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=4
 MICRO_VERSION=67
 INTERFACE_AGE=67
 BINARY_AGE=67
-EXTRA_VERSION=claws3
+EXTRA_VERSION=claws4
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl
index de27250..2d1d94b 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2000 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2001 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
@@ -259,7 +259,6 @@ FolderView *folderview_create(void)
        gtk_widget_set_usize(scrolledwin,
                             prefs_common.folderview_width,
                             prefs_common.folderview_height);
-       //                   COL_FOLDER_WIDTH + COL_NUM_WIDTH - 3, -1);
 
        ctree = gtk_ctree_new_with_titles(N_FOLDER_COLS, COL_FOLDER, titles);
        gtk_container_add(GTK_CONTAINER(scrolledwin), ctree);
@@ -282,7 +281,7 @@ FolderView *folderview_create(void)
        gtk_ctree_set_expander_style(GTK_CTREE(ctree),
                                     GTK_CTREE_EXPANDER_SQUARE);
        gtk_ctree_set_indent(GTK_CTREE(ctree), CTREE_INDENT);
-       //gtk_clist_set_reorderable(GTK_CLIST(ctree), TRUE);
+       
        /* don't let title buttons take key focus */
        for (i = 0; i < N_FOLDER_COLS; i++)
                GTK_WIDGET_UNSET_FLAGS(GTK_CLIST(ctree)->column[i].button,
@@ -450,36 +449,42 @@ void folderview_unselect(FolderView *folderview)
        folderview->selected = folderview->opened = NULL;
 }
 
-void folderview_select_next_unread(FolderView *folderview)
+static GtkCTreeNode *folderview_find_next_unread(GtkCTree *ctree,
+                                                GtkCTreeNode *node)
 {
-       GtkCTree *ctree = GTK_CTREE(folderview->ctree);
-       GtkCTreeNode *node;
        FolderItem *item;
 
-       if (folderview->opened)
-               node = GTK_CTREE_NODE_NEXT(folderview->opened);
+       if (node)
+               node = gtkut_ctree_node_next(ctree, node);
        else
-               node = gtk_ctree_node_nth(ctree, 1);
+               node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
 
-       for (; node != NULL; node = GTK_CTREE_NODE_NEXT(node)) {
+       for (; node != NULL; node = gtkut_ctree_node_next(ctree, node)) {
                item = gtk_ctree_node_get_row_data(ctree, node);
-               if (item && (item->unread > 0 || item->new > 0) &&
-                   item->stype != F_TRASH) {
-                       folderview_select_node(folderview, node);
-                       return;
-               }
+               if (item && item->unread > 0 && item->stype != F_TRASH)
+                       return node;
        }
-       if (!folderview->opened) return;
-       /* search again from the first node */
-       for (node = gtk_ctree_node_nth(ctree, 1); node != NULL;
-            node = GTK_CTREE_NODE_NEXT(node)) {
-               item = gtk_ctree_node_get_row_data(ctree, node);
-               if (item && (item->unread > 0 || item->new > 0) &&
-                   item->stype != F_TRASH) {
-                       folderview_select_node(folderview, node);
-                       return;
-               }
+
+       return NULL;
+}
+
+void folderview_select_next_unread(FolderView *folderview)
+{
+       GtkCTree *ctree = GTK_CTREE(folderview->ctree);
+       GtkCTreeNode *node = NULL;
+
+       if ((node = folderview_find_next_unread(ctree, folderview->opened))
+           != NULL) {
+               folderview_select_node(folderview, node);
+               return;
        }
+
+       if (!folderview->opened ||
+           folderview->opened == GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list))
+               return;
+       /* search again from the first node */
+       if ((node = folderview_find_next_unread(ctree, NULL)) != NULL)
+               folderview_select_node(folderview, node);
 }
 
 void folderview_update_msg_num(FolderView *folderview, GtkCTreeNode *row,
@@ -785,7 +790,6 @@ static void folderview_update_node(FolderView *folderview, GtkCTreeNode *node)
                                              add_unread_mark ? "+" : "");
                else
                        str = g_strdup_printf("%s (+)", name);
-               str = g_strdup_printf("%s (%d)", name, item->unread);
                gtk_ctree_set_node_info(ctree, node, str, FOLDER_SPACING,
                                        xpm, mask, openxpm, openmask,
                                        FALSE, GTK_CTREE_ROW(node)->expanded);
index e66f612..67e15ea 100644 (file)
@@ -168,6 +168,26 @@ gint gtkut_ctree_get_nth_from_node(GtkCTree *ctree, GtkCTreeNode *node)
        return g_list_position(GTK_CLIST(ctree)->row_list, (GList *)node);
 }
 
+/* get the next node, including the invisible one */
+GtkCTreeNode *gtkut_ctree_node_next(GtkCTree *ctree, GtkCTreeNode *node)
+{
+       GtkCTreeNode *parent;
+
+       if (GTK_CTREE_ROW(node)->children)
+               return GTK_CTREE_ROW(node)->children;
+
+       if (GTK_CTREE_ROW(node)->sibling)
+               return GTK_CTREE_ROW(node)->sibling;
+
+       for (parent = GTK_CTREE_ROW(node)->parent; parent != NULL;
+            parent = GTK_CTREE_ROW(parent)->parent) {
+               if (GTK_CTREE_ROW(parent)->sibling)
+                       return GTK_CTREE_ROW(parent)->sibling;
+       }
+
+       return NULL;
+}
+
 void gtkut_ctree_set_focus_row(GtkCTree *ctree, GtkCTreeNode *node)
 {
        gtkut_clist_set_focus_row(GTK_CLIST(ctree),
index ef37ccd..27f5a92 100644 (file)
@@ -75,6 +75,8 @@ void gtkut_ctree_node_move_if_on_the_edge
                                         GtkCTreeNode   *node);
 gint gtkut_ctree_get_nth_from_node     (GtkCTree       *ctree,
                                         GtkCTreeNode   *node);
+GtkCTreeNode *gtkut_ctree_node_next    (GtkCTree       *ctree,
+                                        GtkCTreeNode   *node);
 void gtkut_ctree_set_focus_row         (GtkCTree       *ctree,
                                         GtkCTreeNode   *node);
 void gtkut_clist_set_focus_row         (GtkCList       *clist,
index f4168fa..5335d0d 100644 (file)
@@ -442,7 +442,7 @@ static void lock_socket_input_cb(gpointer data,
        gchar buf[BUFFSIZE];
 
        sock = fd_accept(source);
-       fd_read(sock, buf, sizeof(buf));
+       fd_gets(sock, buf, sizeof(buf));
        fd_close(sock);
 
        if (!strncmp(buf, "popup", 5)){
index 688c4da..af867b6 100644 (file)
@@ -428,7 +428,7 @@ gint fd_write(gint fd, const gchar *buf, gint len)
        return wrlen;
 }
 
-static gint fd_gets(gint fd, gchar *buf, gint len)
+gint fd_gets(gint fd, gchar *buf, gint len)
 {
        gchar *newline, *bp = buf;
        gint n;
index c532a81..d439ee8 100644 (file)
@@ -94,6 +94,7 @@ gint fd_accept                (gint sock);
 
 gint fd_read           (gint sock, gchar *buf, gint len);
 gint fd_write          (gint sock, const gchar *buf, gint len);
+gint fd_gets           (gint sock, gchar *buf, gint len);
 gint fd_close          (gint sock);
 
 #endif /* __SOCKET_H__ */