2005-10-14 [paul] 1.9.15cvs46
authorPaul Mangan <paul@claws-mail.org>
Fri, 14 Oct 2005 14:38:19 +0000 (14:38 +0000)
committerPaul Mangan <paul@claws-mail.org>
Fri, 14 Oct 2005 14:38:19 +0000 (14:38 +0000)
* src/folderview.c
indicate presense of marked msgs in
unexpanded subfolders

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/folderview.c

index d02eeda..5327f8c 100644 (file)
@@ -1,3 +1,9 @@
+2005-10-14 [paul]      1.9.15cvs46
+
+       * src/folderview.c
+               indicate presense of marked msgs in
+               unexpanded subfolders
+
 2005-10-14 [paul]      1.9.15cvs45
 
        * src/prefs_actions.c
index b0e33ca..3ca7126 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.5.2.9 -r 1.5.2.10 src/noticeview.c;  cvs diff -u -r 1.3.8.4 -r 1.3.8.5 src/noticeview.h;  ) > 1.9.15cvs43.patchset
 ( cvs diff -u -r 1.83.2.43 -r 1.83.2.44 src/mimeview.c;  cvs diff -u -r 1.5.2.10 -r 1.5.2.11 src/noticeview.c;  cvs diff -u -r 1.3.8.5 -r 1.3.8.6 src/noticeview.h;  ) > 1.9.15cvs44.patchset
 ( cvs diff -u -r 1.60.2.24 -r 1.60.2.25 src/prefs_actions.c;  cvs diff -u -r 1.204.2.61 -r 1.204.2.62 src/prefs_common.c;  cvs diff -u -r 1.103.2.31 -r 1.103.2.32 src/prefs_common.h;  cvs diff -u -r 1.1.4.20 -r 1.1.4.21 src/prefs_filtering_action.c;  cvs diff -u -r 1.43.2.26 -r 1.43.2.27 src/prefs_matcher.c;  cvs diff -u -r 1.12.2.15 -r 1.12.2.16 src/prefs_template.c;  ) > 1.9.15cvs45.patchset
+( cvs diff -u -r 1.207.2.72 -r 1.207.2.73 src/folderview.c;  ) > 1.9.15cvs46.patchset
index 70ba5f9..8422c5c 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=15
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=45
+EXTRA_VERSION=46
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 6658267..38326a0 100644 (file)
@@ -1210,6 +1210,43 @@ static gboolean folderview_have_matching_children(FolderView *folderview,
        return folderview_have_matching_children_sub(folderview, item, FALSE);
 }
 
+static gboolean folderview_have_marked_children_sub(FolderView *folderview,
+                                                   FolderItem *item,
+                                                   gboolean in_sub)
+{
+       GNode *node = NULL;
+       
+       if (!item || !item->folder || !item->folder->node)
+               return FALSE;
+               
+       node = item->folder->node;
+       
+       node = g_node_find(node, G_PRE_ORDER, G_TRAVERSE_ALL, item);
+       node = node->children;
+
+       if (item->marked_msgs != 0) {
+               return TRUE;
+       }
+
+       while (node != NULL) {
+               if (node && node->data) {
+                       FolderItem *next_item = (FolderItem*) node->data;
+                       node = node->next;
+                       if (folderview_have_marked_children_sub(folderview,
+                                                               next_item, TRUE))
+                               return TRUE;
+               }
+       }
+
+       return FALSE;
+}
+
+static gboolean folderview_have_marked_children(FolderView *folderview,
+                                            FolderItem *item)
+{
+       return folderview_have_marked_children_sub(folderview, item, FALSE);
+}
+
 static void folderview_update_node(FolderView *folderview, GtkCTreeNode *node)
 {
        GtkCTree *ctree = GTK_CTREE(folderview->ctree);
@@ -1232,7 +1269,10 @@ static void folderview_update_node(FolderView *folderview, GtkCTreeNode *node)
        item = gtk_ctree_node_get_row_data(ctree, node);
        g_return_if_fail(item != NULL);
 
-       mark = (item->marked_msgs != 0);
+       if (!GTK_CTREE_ROW(node)->expanded)
+               mark = folderview_have_marked_children(folderview, item);
+       else
+               mark = (item->marked_msgs != 0);
 
        stype = item->stype;
        if (stype == F_NORMAL) {