2006-09-08 [colin] 2.4.0cvs164
authorColin Leroy <colin@colino.net>
Fri, 8 Sep 2006 21:00:02 +0000 (21:00 +0000)
committerColin Leroy <colin@colino.net>
Fri, 8 Sep 2006 21:00:02 +0000 (21:00 +0000)
* src/folder.c
Wrong assert, make it an if()
* src/gtk/gtksctree.c
Fix bug #1013 (expand selected thread
tree) - expanding is now recursive

ChangeLog
PATCHSETS
configure.ac
src/folder.c
src/gtk/gtksctree.c

index 1a0579547775401fcefb6440cb890d0bfc70a5d4..52db43b0b95a4f99d4de3ce9e3826648f0464113 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-09-08 [colin]     2.4.0cvs164
+
+       * src/folder.c
+               Wrong assert, make it an if()
+       * src/gtk/gtksctree.c
+               Fix bug #1013 (expand selected thread 
+               tree) - expanding is now recursive
+
 2006-09-07 [wwp]       2.4.0cvs163
 
        * src/prefs_matcher.c
index d28368f5a6d8787c15f11e17b8163b903c49c93e..86c822e2f3d97546eb868be25adccf3fc4ba48f4 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.395.2.245 -r 1.395.2.246 src/summaryview.c;  ) > 2.4.0cvs161.patchset
 ( cvs diff -u -r 1.59.2.44 -r 1.59.2.45 src/prefs_filtering.c;  ) > 2.4.0cvs162.patchset
 ( cvs diff -u -r 1.43.2.44 -r 1.43.2.45 src/prefs_matcher.c;  ) > 2.4.0cvs163.patchset
+( cvs diff -u -r 1.213.2.113 -r 1.213.2.114 src/folder.c;  cvs diff -u -r 1.1.4.28 -r 1.1.4.29 src/gtk/gtksctree.c;  ) > 2.4.0cvs164.patchset
index 8a3c48e2efe55e696f18a0969192bee3f13022b5..385b913f4a222c5c1e51123f0c19289fbfc7f6f7 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=4
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=163
+EXTRA_VERSION=164
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 0d18ba0f3b54b4a99cb4fa95d2cc144a0e644ed2..4c3f8f8b60182d8eede41de4a7d6f70cf0d3d13f 100644 (file)
@@ -1202,7 +1202,9 @@ gchar *folder_item_get_identifier(FolderItem *item)
        gchar *folder_id = NULL;
 
        g_return_val_if_fail(item != NULL, NULL);
-       g_return_val_if_fail(item->path != NULL, NULL);
+
+       if (item->path == NULL)
+               return NULL;
 
        folder_id = folder_get_identifier(item->folder);
        id = g_strconcat(folder_id, "/", item->path, NULL);
index 847841a38e8ea17bb62aa09af45419e6e8470607..87f923afaaa888391237a87957a5b917e4545d79 100644 (file)
@@ -1253,6 +1253,48 @@ gtk_sctree_draw_row (GtkCList     *clist,
     }
 }
 
+static void
+gtk_sctree_change_focus_row_expansion (GtkCTree          *ctree,
+                           GtkCTreeExpansionType action)
+{
+  GtkCList *clist;
+  GtkCTreeNode *node;
+
+  g_return_if_fail (GTK_IS_CTREE (ctree));
+
+  clist = GTK_CLIST (ctree);
+
+  if (gdk_display_pointer_is_grabbed (gtk_widget_get_display (GTK_WIDGET (ctree))) && 
+      GTK_WIDGET_HAS_GRAB (ctree))
+    return;
+  
+  if (!(node =
+       GTK_CTREE_NODE (g_list_nth (clist->row_list, clist->focus_row))) ||
+      GTK_CTREE_ROW (node)->is_leaf || !(GTK_CTREE_ROW (node)->children))
+    return;
+
+  switch (action)
+    {
+    case GTK_CTREE_EXPANSION_EXPAND:
+      gtk_ctree_expand_recursive (ctree, node);
+      break;
+    case GTK_CTREE_EXPANSION_EXPAND_RECURSIVE:
+      gtk_ctree_expand_recursive (ctree, node);
+      break;
+    case GTK_CTREE_EXPANSION_COLLAPSE:
+      gtk_ctree_collapse (ctree, node);
+      break;
+    case GTK_CTREE_EXPANSION_COLLAPSE_RECURSIVE:
+      gtk_ctree_collapse_recursive (ctree, node);
+      break;
+    case GTK_CTREE_EXPANSION_TOGGLE:
+      gtk_ctree_toggle_expansion_recursive (ctree, node);
+      break;
+    case GTK_CTREE_EXPANSION_TOGGLE_RECURSIVE:
+      gtk_ctree_toggle_expansion_recursive (ctree, node);
+      break;
+    }
+}
 
 /* Standard class initialization function */
 static void
@@ -1314,7 +1356,8 @@ gtk_sctree_class_init (GtkSCTreeClass *klass)
         ctree_class->tree_collapse = gtk_sctree_collapse;
        ctree_class->tree_expand = gtk_sctree_real_tree_expand;
        ctree_class->tree_move = sreal_tree_move;
-       
+       ctree_class->change_focus_row_expansion = gtk_sctree_change_focus_row_expansion;
+
        widget_class->button_press_event = gtk_sctree_button_press;
        widget_class->button_release_event = gtk_sctree_button_release;
        widget_class->motion_notify_event = gtk_sctree_motion;
@@ -1492,7 +1535,7 @@ gtk_sctree_button_press (GtkWidget *widget, GdkEventButton *event)
                gtk_widget_grab_focus (widget);
 
        if (gtk_ctree_is_hot_spot (GTK_CTREE(sctree), event->x, event->y)) {
-               gtk_ctree_toggle_expansion
+               gtk_ctree_toggle_expansion_recursive
                        (GTK_CTREE(sctree), 
                         gtk_ctree_node_nth(GTK_CTREE(sctree), row));
                return TRUE;
@@ -2785,6 +2828,7 @@ gtk_sctree_real_tree_expand (GtkCTree     *ctree,
     /* resize tree_column if needed */
     gtk_sctree_column_auto_resize (clist, &GTK_CTREE_ROW (node)->row, ctree->tree_column,
                        requisition.width);
+
 }
 
 GtkCTreeNode *