aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-tree-memory.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2002-03-09 05:45:03 +0800
committerChris Lahey <clahey@src.gnome.org>2002-03-09 05:45:03 +0800
commit9c939e7a9964b860fcfa5bdc0ca13aeaa2d74f36 (patch)
treeb3045b26f8fa672bdf6018a3ccd73b66d8f0ad35 /widgets/table/e-tree-memory.c
parente4e819b0ae44665678aa2ff08635be6e5090c004 (diff)
downloadgsoc2013-evolution-9c939e7a9964b860fcfa5bdc0ca13aeaa2d74f36.tar
gsoc2013-evolution-9c939e7a9964b860fcfa5bdc0ca13aeaa2d74f36.tar.gz
gsoc2013-evolution-9c939e7a9964b860fcfa5bdc0ca13aeaa2d74f36.tar.bz2
gsoc2013-evolution-9c939e7a9964b860fcfa5bdc0ca13aeaa2d74f36.tar.lz
gsoc2013-evolution-9c939e7a9964b860fcfa5bdc0ca13aeaa2d74f36.tar.xz
gsoc2013-evolution-9c939e7a9964b860fcfa5bdc0ca13aeaa2d74f36.tar.zst
gsoc2013-evolution-9c939e7a9964b860fcfa5bdc0ca13aeaa2d74f36.zip
Handle a collapse request by marking all descendents of that node as
2002-03-08 Christopher James Lahey <clahey@ximian.com> * e-tree-memory.c (etmm_node_request_collapse): Handle a collapse request by marking all descendents of that node as needing their children recomputed. * e-tree-model.c, e-tree-model.h (e_tree_model_node_request_collapse): Added this signal to request that the view of your tree collapse this node. * e-tree-selection-model.c (etsm_selected_count): Pass the root of the sorted model here instead of the root of the base model. * e-tree-table-adapter.c (etta_proxy_node_request_collapse): Handle a collapse request by collapsing the node in the tree. svn path=/trunk/; revision=15990
Diffstat (limited to 'widgets/table/e-tree-memory.c')
-rw-r--r--widgets/table/e-tree-memory.c48
1 files changed, 35 insertions, 13 deletions
diff --git a/widgets/table/e-tree-memory.c b/widgets/table/e-tree-memory.c
index 74c160ab9f..27948727f7 100644
--- a/widgets/table/e-tree-memory.c
+++ b/widgets/table/e-tree-memory.c
@@ -329,6 +329,26 @@ etmm_get_expanded_default (ETreeModel *etm)
return priv->expanded_default;
}
+static void
+etmm_clear_children_computed (ETreeMemoryPath *path)
+{
+ for (path = path->first_child; path; path = path->next_sibling) {
+ path->children_computed = FALSE;
+ etmm_clear_children_computed (path);
+ }
+}
+
+static void
+etmm_node_request_collapse (ETreeModel *etm, ETreePath node)
+{
+ if (node)
+ etmm_clear_children_computed (node);
+
+ if (parent_class->node_request_collapse) {
+ parent_class->node_request_collapse (etm, node);
+ }
+}
+
static void
e_tree_memory_class_init (ETreeMemoryClass *klass)
@@ -350,22 +370,24 @@ e_tree_memory_class_init (ETreeMemoryClass *klass)
E_OBJECT_CLASS_ADD_SIGNALS (object_class, signals, LAST_SIGNAL);
- object_class->destroy = etmm_destroy;
+ object_class->destroy = etmm_destroy;
+
+ tree_class->get_root = etmm_get_root;
+ tree_class->get_prev = etmm_get_prev;
+ tree_class->get_next = etmm_get_next;
+ tree_class->get_first_child = etmm_get_first_child;
+ tree_class->get_last_child = etmm_get_last_child;
+ tree_class->get_parent = etmm_get_parent;
- tree_class->get_root = etmm_get_root;
- tree_class->get_prev = etmm_get_prev;
- tree_class->get_next = etmm_get_next;
- tree_class->get_first_child = etmm_get_first_child;
- tree_class->get_last_child = etmm_get_last_child;
- tree_class->get_parent = etmm_get_parent;
+ tree_class->is_root = etmm_is_root;
+ tree_class->is_expandable = etmm_is_expandable;
+ tree_class->get_children = etmm_get_children;
+ tree_class->depth = etmm_depth;
+ tree_class->get_expanded_default = etmm_get_expanded_default;
- tree_class->is_root = etmm_is_root;
- tree_class->is_expandable = etmm_is_expandable;
- tree_class->get_children = etmm_get_children;
- tree_class->depth = etmm_depth;
- tree_class->get_expanded_default = etmm_get_expanded_default;
+ tree_class->node_request_collapse = etmm_node_request_collapse;
- klass->fill_in_children = NULL;
+ klass->fill_in_children = NULL;
}
static void