diff options
author | Kristian Rietveld <kris@gtk.org> | 2003-12-13 15:20:28 +0000 |
---|---|---|
committer | Kristian Rietveld <kristian@src.gnome.org> | 2003-12-13 15:20:28 +0000 |
commit | 5f3cde77ba2c4835e12f8bdee12aeec19a8e0483 (patch) | |
tree | 501c744dd2272806b5e8b2dd69229861d3c6a667 /gtk/gtktreemodelsort.c | |
parent | cf98c97946ccd8b92ea924474716325bc053830e (diff) | |
download | gtk+-5f3cde77ba2c4835e12f8bdee12aeec19a8e0483.tar.gz |
A trick for a faster treeview, step 1. Patch to short circuit
Sat Dec 13 16:13:27 2003 Kristian Rietveld <kris@gtk.org>
A trick for a faster treeview, step 1. Patch to short circuit
_build_tree(), inspired by Jonathan (#80868).
* gtk/gtktreeview.c (gtk_tree_view_init): don't put _IS_LIST in
flags by default,
(gtk_tree_view_build_tree): don't even try to recurse when the
model says that it is a list, remove flag unsetter,
(gtk_tree_view_set_model): change flag setting logic.
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_get_flags):
propagate whether or not the child model has _IS_LIST set.
* gtk/gtktreemodelfilter.c (gtk_tree_model_filter_get_flags):
ditto.
Diffstat (limited to 'gtk/gtktreemodelsort.c')
-rw-r--r-- | gtk/gtktreemodelsort.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gtk/gtktreemodelsort.c b/gtk/gtktreemodelsort.c index e7a31713c5..eacb3d5c0a 100644 --- a/gtk/gtktreemodelsort.c +++ b/gtk/gtktreemodelsort.c @@ -899,7 +899,15 @@ gtk_tree_model_sort_rows_reordered (GtkTreeModel *s_model, static GtkTreeModelFlags gtk_tree_model_sort_get_flags (GtkTreeModel *tree_model) { + GtkTreeModelFlags flags; + g_return_val_if_fail (GTK_IS_TREE_MODEL_SORT (tree_model), 0); + g_return_val_if_fail (GTK_TREE_MODEL_SORT (tree_model)->child_model != NULL, 0); + + flags = gtk_tree_model_get_flags (GTK_TREE_MODEL_SORT (tree_model)->child_model); + + if ((flags & GTK_TREE_MODEL_LIST_ONLY) == GTK_TREE_MODEL_LIST_ONLY) + return GTK_TREE_MODEL_LIST_ONLY; return 0; } |