sync with sylpheed 0.6.5cvs9
authorPaul Mangan <paul@claws-mail.org>
Sun, 18 Nov 2001 12:23:39 +0000 (12:23 +0000)
committerPaul Mangan <paul@claws-mail.org>
Sun, 18 Nov 2001 12:23:39 +0000 (12:23 +0000)
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
src/grouplistdialog.c
src/imap.c
src/news.c
src/textview.c

index d203f72..4597117 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2001-11-18
+
+       * src/textview.c: textview_show_part(): show headers on nested
+         muitipart text.
+
+2001-11-17
+
+       * src/imap.c: imap_session_get()
+         src/news.c: news_session_get(): fixed segfault when reconnection
+         failed.
+       * src/grouplistdialog.c: removed redundant code, and expand nodes
+         that doesn't match the pattern.
+
 2001-11-16
 
        * src/compose.c: modified so that it sends message when any of
index 33addc4..8c4cfec 100644 (file)
@@ -1,3 +1,8 @@
+2001-11-18 [paul]      0.6.5claws18
+
+       * sync with sylpheed 0.6.5cvs9
+               see ChangeLog entries 2001-11-17 and 2001-11-18
+
 2001-11-16 [paul]      0.6.5claws17
 
        * sync with sylpheed 0.6.5cvs8
index 7a91f89..9c612dc 100644 (file)
@@ -1,3 +1,16 @@
+2001-11-18
+
+       * src/textview.c: textview_show_part(): ¥Í¥¹¥È¤µ¤ì¤¿¥Þ¥ë¥Á¥Ñ¡¼¥È
+         ¥Æ¥­¥¹¥È¤Ç¥Ø¥Ã¥À¤òɽ¼¨¡£
+
+2001-11-17
+
+       * src/imap.c: imap_session_get()
+         src/news.c: news_session_get(): ºÆÀܳ¤Ë¼ºÇÔ¤·¤¿¤È¤­¤Î segfault
+         ¤ò½¤Àµ¡£
+       * src/grouplistdialog.c: Í¾Ê¬¤Ê¥³¡¼¥É¤òºï½ü¤·¡¢¥Ñ¥¿¡¼¥ó¤Ë¥Þ¥Ã¥Á
+         ¤·¤Ê¤¤¥Î¡¼¥É¤òŸ³«¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+
 2001-11-16
 
        * src/compose.c: To:, Cc:, Bcc:, Newsgroups: ¤Î¤É¤ì¤«¤¬Í­¸ú¤Ê
index 8f6b0c7..82ba8af 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=6
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws17
+EXTRA_VERSION=claws18
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl
index 0a52372..aa54888 100644 (file)
@@ -70,7 +70,7 @@ static Folder *news_folder;
 static GSList *subscribed;
 
 static void grouplist_dialog_create    (void);
-static void grouplist_dialog_set_list  (gchar          *pattern,
+static void grouplist_dialog_set_list  (const gchar    *pattern,
                                         gboolean        refresh);
 static void grouplist_search           (void);
 static void grouplist_clear            (void);
@@ -258,22 +258,17 @@ static void grouplist_dialog_create(void)
        gtk_widget_show_all(GTK_DIALOG(dialog)->vbox);
 }
 
-static GHashTable *last_node_table;
 static GHashTable *branch_node_table;
 
 static void grouplist_hash_init(void)
 {
-       last_node_table = g_hash_table_new(g_str_hash, g_str_equal);
        branch_node_table = g_hash_table_new(g_str_hash, g_str_equal);
 }
 
 static void grouplist_hash_done(void)
 {
        hash_free_strings(branch_node_table);
-       hash_free_strings(last_node_table);
-
        g_hash_table_destroy(branch_node_table);
-       g_hash_table_destroy(last_node_table);
 }
 
 static GtkCTreeNode *grouplist_hash_get_branch_node(const gchar *name)
@@ -287,26 +282,6 @@ static void grouplist_hash_set_branch_node(const gchar *name,
        g_hash_table_insert(branch_node_table, g_strdup(name), node);
 }
 
-static GtkCTreeNode *grouplist_hash_get_last_node(const gchar *name)
-{
-       return g_hash_table_lookup(last_node_table, name);
-}
-
-static void grouplist_hash_set_last_node(const gchar *name,
-                                        GtkCTreeNode *node)
-{
-       gchar *key;
-       gpointer value;
-
-       if (g_hash_table_lookup_extended(last_node_table, name,
-                                        (gpointer *)&key, &value)) {
-               g_hash_table_remove(last_node_table, name);
-               g_free(key);
-       }
-
-       g_hash_table_insert(last_node_table, g_strdup(name), node);
-}
-
 static gchar *grouplist_get_parent_name(const gchar *name)
 {
        gchar *p;
@@ -317,7 +292,8 @@ static gchar *grouplist_get_parent_name(const gchar *name)
        return g_strndup(name, p - name);
 }
 
-static GtkCTreeNode *grouplist_create_parent(const gchar *name)
+static GtkCTreeNode *grouplist_create_parent(const gchar *name,
+                                            const gchar *pattern)
 {
        GtkCTreeNode *parent;
        GtkCTreeNode *node;
@@ -332,14 +308,17 @@ static GtkCTreeNode *grouplist_create_parent(const gchar *name)
        cols[1] = cols[2] = "";
 
        parent_name = grouplist_get_parent_name(name);
-       parent = grouplist_create_parent(parent_name);
+       parent = grouplist_create_parent(parent_name, pattern);
 
-       node = grouplist_hash_get_last_node(parent_name);
+       node = parent ? GTK_CTREE_ROW(parent)->children
+               : GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
        node = gtk_ctree_insert_node(GTK_CTREE(ctree), parent, node,
                                     cols, 0, NULL, NULL, NULL, NULL,
                                     FALSE, FALSE);
+       if (parent && fnmatch(pattern, parent_name, 0) != 0)
+               gtk_ctree_expand(GTK_CTREE(ctree), parent);
        gtk_ctree_node_set_selectable(GTK_CTREE(ctree), node, FALSE);
-       grouplist_hash_set_last_node(parent_name, node);
+
        grouplist_hash_set_branch_node(name, node);
 
        g_free(parent_name);
@@ -347,7 +326,8 @@ static GtkCTreeNode *grouplist_create_parent(const gchar *name)
        return node;
 }
 
-static GtkCTreeNode *grouplist_create_branch(NewsGroupInfo *ginfo)
+static GtkCTreeNode *grouplist_create_branch(NewsGroupInfo *ginfo,
+                                            const gchar *pattern)
 {
        GtkCTreeNode *node;
        GtkCTreeNode *parent;
@@ -374,7 +354,7 @@ static GtkCTreeNode *grouplist_create_branch(NewsGroupInfo *ginfo)
                cols[2] = _("unknown");
 
        parent_name = grouplist_get_parent_name(name);
-       parent = grouplist_create_parent(parent_name);
+       parent = grouplist_create_parent(parent_name, pattern);
        node = grouplist_hash_get_branch_node(name);
        if (node) {
                gtk_ctree_set_node_info(GTK_CTREE(ctree), node, cols[0], 0,
@@ -382,23 +362,24 @@ static GtkCTreeNode *grouplist_create_branch(NewsGroupInfo *ginfo)
                gtk_ctree_node_set_text(GTK_CTREE(ctree), node, 1, cols[1]);
                gtk_ctree_node_set_text(GTK_CTREE(ctree), node, 2, cols[2]);
        } else {
-               node = grouplist_hash_get_last_node(parent_name);
+               node = parent ? GTK_CTREE_ROW(parent)->children
+                       : GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
                node = gtk_ctree_insert_node(GTK_CTREE(ctree), parent, node,
                                             cols, 0, NULL, NULL, NULL, NULL,
                                             TRUE, FALSE);
+               if (parent && fnmatch(pattern, parent_name, 0) != 0)
+                       gtk_ctree_expand(GTK_CTREE(ctree), parent);
        }
        gtk_ctree_node_set_selectable(GTK_CTREE(ctree), node, TRUE);
        if (node)
                gtk_ctree_node_set_row_data(GTK_CTREE(ctree), node, ginfo);
 
-       grouplist_hash_set_last_node(parent_name, node);
-
        g_free(parent_name);
 
        return node;
 }
 
-static void grouplist_dialog_set_list(gchar *pattern, gboolean refresh)
+static void grouplist_dialog_set_list(const gchar *pattern, gboolean refresh)
 {
        GSList *cur;
        GtkCTreeNode *node;
@@ -443,7 +424,7 @@ static void grouplist_dialog_set_list(gchar *pattern, gboolean refresh)
                NewsGroupInfo *ginfo = (NewsGroupInfo *)cur->data;
 
                if (fnmatch(pattern, ginfo->name, 0) == 0) {
-                       node = grouplist_create_branch(ginfo);
+                       node = grouplist_create_branch(ginfo, pattern);
                        if (g_slist_find_custom(subscribed, ginfo->name,
                                                (GCompareFunc)g_strcasecmp)
                            != NULL)
index e8703b2..d836074 100644 (file)
@@ -289,7 +289,8 @@ static IMAPSession *imap_session_get(Folder *folder)
                                             IMAP_FOLDER(folder));
        }
 
-       rfolder->session->last_access_time = time(NULL);
+       if (rfolder->session)
+               rfolder->session->last_access_time = time(NULL);
        statusbar_pop_all();
        return IMAP_SESSION(rfolder->session);
 }
index 56b86a8..e58d52a 100644 (file)
@@ -194,7 +194,8 @@ NNTPSession *news_session_get(Folder *folder)
                rfolder->session = news_session_new_for_folder(folder);
        }
 
-       rfolder->session->last_access_time = time(NULL);
+       if (rfolder->session)
+               rfolder->session->last_access_time = time(NULL);
        statusbar_pop_all();
        return NNTP_SESSION(rfolder->session);
 }
index f62de07..f96309c 100644 (file)
@@ -297,11 +297,14 @@ void textview_show_part(TextView *textview, MimeInfo *mimeinfo, FILE *fp)
        } else {
                if (mimeinfo->mime_type == MIME_TEXT && mimeinfo->parent) {
                        glong fpos;
+                       MimeInfo *parent = mimeinfo->parent;
+
+                       while (parent->parent)
+                               parent = parent->parent;
 
                        if ((fpos = ftell(fp)) < 0)
                                perror("ftell");
-                       else if (fseek(fp, mimeinfo->parent->fpos, SEEK_SET)
-                                < 0)
+                       else if (fseek(fp, parent->fpos, SEEK_SET) < 0)
                                perror("fseek");
                        else {
                                headers = textview_scan_header(textview, fp);