[Commits] [SCM] claws branch, master, updated. 3.9.3-24-g0f01f38

claws at claws-mail.org claws at claws-mail.org
Mon Feb 17 14:25:36 CET 2014


The branch master of project "claws" (Claws Mail) has been updated
       via  0f01f386bf387482746d87700a6bd2aef93ec0e3 (commit)
      from  77312650287de902893125381088fa7baf8b2124 (commit)


- Log -----------------------------------------------------------------
commit 0f01f386bf387482746d87700a6bd2aef93ec0e3
Author: Paul <paul at claws-mail.org>
Date:   Mon Feb 17 13:25:29 2014 +0000

    indicate when there are messages in Drafts

diff --git a/src/folderview.c b/src/folderview.c
index a5a7ab0..3745aeb 100644
--- a/src/folderview.c
+++ b/src/folderview.c
@@ -1262,6 +1262,43 @@ void folderview_check_new_all(void)
 	inc_unlock();
 }
 
+static gboolean folderview_have_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 (in_sub && item->total_msgs > 0) {
+		return TRUE;
+	}
+
+	while (node != NULL) {
+		if (node && node->data) {
+			FolderItem *next_item = (FolderItem*) node->data;
+			node = node->next;
+			if (folderview_have_children_sub(folderview, 
+							 next_item, TRUE))
+				return TRUE;
+		}
+	}
+
+	return FALSE;
+}
+
+static gboolean folderview_have_children(FolderView *folderview,
+					 FolderItem *item)
+{
+	return folderview_have_children_sub(folderview, item, FALSE);
+}
+
 static gboolean folderview_have_new_children_sub(FolderView *folderview,
 						 FolderItem *item,
 						 gboolean in_sub)
@@ -1599,7 +1636,6 @@ static void folderview_update_node(FolderView *folderview, GtkCMCTreeNode *node)
 	}
 
 	if (folder_has_parent_of_type(item, F_OUTBOX) ||
-	    folder_has_parent_of_type(item, F_DRAFT) ||
 	    folder_has_parent_of_type(item, F_TRASH)) {
 		use_bold = use_color = FALSE;
 	} else if (folder_has_parent_of_type(item, F_QUEUE)) {
@@ -1614,6 +1650,10 @@ static void folderview_update_node(FolderView *folderview, GtkCMCTreeNode *node)
 				break;
 			}
 		}
+	} else if (folder_has_parent_of_type(item, F_DRAFT)) {
+		use_bold = use_color = item->total_msgs > 0 ||
+				       (!GTK_CMCTREE_ROW(node)->expanded &&
+				        folderview_have_children(folderview, item));
 	} else {
 		/* if unread messages exist, print with bold font */
 		use_bold = (item->unread_msgs > 0|| item->new_msgs > 0) 

-----------------------------------------------------------------------

Summary of changes:
 src/folderview.c |   42 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 41 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list