summaryrefslogtreecommitdiff
path: root/gtk/gtktreemodel.c
diff options
context:
space:
mode:
authorJonathan Blandford <jrb@redhat.com>2001-10-01 18:12:34 +0000
committerJonathan Blandford <jrb@src.gnome.org>2001-10-01 18:12:34 +0000
commit58ed9e8bef2eb169917a0eef11fb6b6e0678fd47 (patch)
tree151a2caf0340b17b80911783a044115f4b2b705d /gtk/gtktreemodel.c
parentc6f15f385f9e7f8668743f1d3803013a79e1baed (diff)
downloadgdk-pixbuf-58ed9e8bef2eb169917a0eef11fb6b6e0678fd47.tar.gz
change scroll_to_cell delayed code to happen in size_allocate.
Mon Oct 1 14:07:02 2001 Jonathan Blandford <jrb@redhat.com> * gtk/gtktreeview.c (gtk_tree_view_size_allocate): change scroll_to_cell delayed code to happen in size_allocate. * gtk/gtkstyle.c (gtk_default_draw_expander): change prelight/normal arrow drawing. * gtk/gtktreedatalist.c: Change compare func to use g_utf8_collate * gtk/gtktreestore.c: refactor.
Diffstat (limited to 'gtk/gtktreemodel.c')
-rw-r--r--gtk/gtktreemodel.c61
1 files changed, 25 insertions, 36 deletions
diff --git a/gtk/gtktreemodel.c b/gtk/gtktreemodel.c
index ffde83b8e..ecc23857f 100644
--- a/gtk/gtktreemodel.c
+++ b/gtk/gtktreemodel.c
@@ -1213,25 +1213,29 @@ gtk_tree_row_ref_inserted_callback (GObject *object,
{
GtkTreeRowReference *reference = tmp_list->data;
- if (reference->path)
+ if (reference->path == NULL)
+ goto done;
+
+ if (reference->path->depth >= path->depth)
{
- gint depth = gtk_tree_path_get_depth (path);
- gint ref_depth = gtk_tree_path_get_depth (reference->path);
+ gint i;
+ gboolean ancestor = TRUE;
- if (ref_depth >= depth)
+ for (i = 0; i < path->depth - 1; i ++)
{
- gint *indices = gtk_tree_path_get_indices (path);
- gint *ref_indices = gtk_tree_path_get_indices (reference->path);
- gint i;
-
- /* This is the depth that might affect us. */
- i = depth - 1;
-
- if (indices[i] <= ref_indices[i])
- ref_indices[i] += 1;
+ if (path->indices[i] != reference->path->indices[i])
+ {
+ ancestor = FALSE;
+ break;
+ }
}
- }
+ if (ancestor == FALSE)
+ goto done;
+ if (path->indices[path->depth-1] <= reference->path->indices[path->depth-1])
+ reference->path->indices[path->depth-1] += 1;
+ }
+ done:
tmp_list = g_slist_next (tmp_list);
}
}
@@ -1266,30 +1270,15 @@ gtk_tree_row_ref_deleted_callback (GObject *object,
if (reference->path)
{
- gint depth = gtk_tree_path_get_depth (path);
- gint ref_depth = gtk_tree_path_get_depth (reference->path);
-
- if (ref_depth >= depth)
+ if (gtk_tree_path_is_ancestor (path, reference->path))
{
- /* Need to adjust path upward */
- gint *indices = gtk_tree_path_get_indices (path);
- gint *ref_indices = gtk_tree_path_get_indices (reference->path);
- gint i;
-
- i = depth - 1;
- if (indices[i] < ref_indices[i])
- ref_indices[i] -= 1;
- else if (indices[i] == ref_indices[i])
- {
- /* the referenced node itself, or its parent, was
- * deleted, mark invalid
- */
-
- gtk_tree_path_free (reference->path);
- reference->path = NULL;
- }
+ reference->path->indices[path->depth-1]-=1;
+ }
+ else if (gtk_tree_path_compare (path, reference->path) == 0)
+ {
+ gtk_tree_path_free (reference->path);
+ reference->path = NULL;
}
-
}
tmp_list = g_slist_next (tmp_list);
}