aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-tree-table-adapter.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-04-04 16:37:14 +0800
committerChris Lahey <clahey@src.gnome.org>2001-04-04 16:37:14 +0800
commit91f381352f9bff029bf8f2cf3ebe35272262e75f (patch)
tree644aa7c14eddfcb418cc80ddb7dbe7ee7070655b /widgets/table/e-tree-table-adapter.c
parent8940bcc90c4ecbfdd01bd7224005f575b0df6a2a (diff)
downloadgsoc2013-evolution-91f381352f9bff029bf8f2cf3ebe35272262e75f.tar.gz
gsoc2013-evolution-91f381352f9bff029bf8f2cf3ebe35272262e75f.tar.zst
gsoc2013-evolution-91f381352f9bff029bf8f2cf3ebe35272262e75f.zip
Added e_tree_selection_model_select_single_path and made selection_start
2001-04-04 Christopher James Lahey <clahey@ximian.com> * e-tree-selection-model.c, e-tree-selection-model.h: Added e_tree_selection_model_select_single_path and made selection_start be the path as it should be instead of the row. * e-tree-sorted.c: Added a last_access variable to speed up access. * e-tree-table-adapter.c: Made checking last_access look at the 10 values before and after the listed value to look for the value requested. * e-tree.c: Call e_tree_selection_model_select_single_path if E_TREE_USE_TREE_SELECTION. svn path=/trunk/; revision=9169
Diffstat (limited to 'widgets/table/e-tree-table-adapter.c')
-rw-r--r--widgets/table/e-tree-table-adapter.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/widgets/table/e-tree-table-adapter.c b/widgets/table/e-tree-table-adapter.c
index 5498d82358..71c73d7724 100644
--- a/widgets/table/e-tree-table-adapter.c
+++ b/widgets/table/e-tree-table-adapter.c
@@ -233,8 +233,23 @@ find_row_num(ETreeTableAdapter *etta, ETreePath path)
if (path == NULL)
return -1;
- if (etta->priv->last_access != -1 && etta->priv->map_table[etta->priv->last_access] == path)
- return etta->priv->last_access;
+ if (etta->priv->last_access != -1) {
+ int end = MIN(etta->priv->n_map, etta->priv->last_access + 10);
+ int start = MAX(0, etta->priv->last_access - 10);
+ for (i = etta->priv->last_access; i < end; i++) {
+ if(etta->priv->map_table[i] == path) {
+ d(g_print("Found last access %d at row %d. (find_row_num)\n", etta->priv->last_access, i));
+ return i;
+ }
+ }
+ for (i = etta->priv->last_access - 1; i <= start; i++) {
+ if(etta->priv->map_table[i] == path) {
+ d(g_print("Found last access %d at row %d. (find_row_num)\n", etta->priv->last_access, i));
+ return i;
+ }
+ }
+ }
+
depth = e_tree_model_node_depth(etta->priv->source, path);
@@ -268,6 +283,7 @@ find_row_num(ETreeTableAdapter *etta, ETreePath path)
}
g_free (sequence);
+ d(g_print("Didn't find last access %d. Setting to %d. (find_row_num)\n", etta->priv->last_access, row));
etta->priv->last_access = row;
return row;
}