handle gtk-tree-model-drop-append like the ListStore, includes some tweaks

Fri Mar  8 20:41:51 2002  Kristian Rietveld  <kris@gtk.org>

        * gtk/gtktreestore.c (gtk_tree_store_drag_data_received): handle
        gtk-tree-model-drop-append like the ListStore, includes some
        tweaks to work right with trees
This commit is contained in:
Kristian Rietveld 2002-03-08 19:40:15 +00:00 committed by Kristian Rietveld
parent 9c6d85da2b
commit f18a6f79d7
8 changed files with 62 additions and 4 deletions

View File

@ -1,3 +1,9 @@
Fri Mar 8 20:41:51 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreestore.c (gtk_tree_store_drag_data_received): handle
gtk-tree-model-drop-append like the ListStore, includes some
tweaks to work right with trees
Fri Mar 8 14:22:43 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init): Some packing

View File

@ -1,3 +1,9 @@
Fri Mar 8 20:41:51 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreestore.c (gtk_tree_store_drag_data_received): handle
gtk-tree-model-drop-append like the ListStore, includes some
tweaks to work right with trees
Fri Mar 8 14:22:43 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init): Some packing

View File

@ -1,3 +1,9 @@
Fri Mar 8 20:41:51 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreestore.c (gtk_tree_store_drag_data_received): handle
gtk-tree-model-drop-append like the ListStore, includes some
tweaks to work right with trees
Fri Mar 8 14:22:43 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init): Some packing

View File

@ -1,3 +1,9 @@
Fri Mar 8 20:41:51 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreestore.c (gtk_tree_store_drag_data_received): handle
gtk-tree-model-drop-append like the ListStore, includes some
tweaks to work right with trees
Fri Mar 8 14:22:43 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init): Some packing

View File

@ -1,3 +1,9 @@
Fri Mar 8 20:41:51 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreestore.c (gtk_tree_store_drag_data_received): handle
gtk-tree-model-drop-append like the ListStore, includes some
tweaks to work right with trees
Fri Mar 8 14:22:43 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init): Some packing

View File

@ -1,3 +1,9 @@
Fri Mar 8 20:41:51 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreestore.c (gtk_tree_store_drag_data_received): handle
gtk-tree-model-drop-append like the ListStore, includes some
tweaks to work right with trees
Fri Mar 8 14:22:43 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init): Some packing

View File

@ -1,3 +1,9 @@
Fri Mar 8 20:41:51 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreestore.c (gtk_tree_store_drag_data_received): handle
gtk-tree-model-drop-append like the ListStore, includes some
tweaks to work right with trees
Fri Mar 8 14:22:43 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_init): Some packing

View File

@ -1677,15 +1677,31 @@ gtk_tree_store_drag_data_received (GtkTreeDragDest *drag_dest,
prev))
{
GtkTreeIter tmp_iter = dest_iter;
gtk_tree_store_insert_after (GTK_TREE_STORE (tree_model),
&dest_iter,
NULL,
&tmp_iter);
if (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (tree_model), "gtk-tree-model-drop-append")))
{
GtkTreeIter parent;
if (gtk_tree_model_iter_parent (GTK_TREE_MODEL (tree_model), &parent, &tmp_iter))
gtk_tree_store_append (GTK_TREE_STORE (tree_model),
&dest_iter, &parent);
else
gtk_tree_store_append (GTK_TREE_STORE (tree_model),
&dest_iter, NULL);
}
else
gtk_tree_store_insert_after (GTK_TREE_STORE (tree_model),
&dest_iter,
NULL,
&tmp_iter);
retval = TRUE;
}
}
g_object_set_data (G_OBJECT (tree_model), "gtk-tree-model-drop-append",
NULL);
gtk_tree_path_free (prev);
/* If we succeeded in creating dest_iter, walk src_iter tree branch,