summaryrefslogtreecommitdiff
path: root/gtk/gtktreestore.c
diff options
context:
space:
mode:
authorKristian Rietveld <kris@gtk.org>2003-09-09 23:13:39 +0000
committerKristian Rietveld <kristian@src.gnome.org>2003-09-09 23:13:39 +0000
commitb78691f0981303b2a84b26797a466954fad994b6 (patch)
treeae974183dc28c9bc10b9722c2fc04bce7a119d9b /gtk/gtktreestore.c
parent4b3e2d69a5c09303f0b7afd63aeaf49d798713f7 (diff)
downloadgtk+-b78691f0981303b2a84b26797a466954fad994b6.tar.gz
Big TreeView DnD fixage, makes drops on empty models work, makes TreeStore
Wed Sep 10 01:06:44 2003 Kristian Rietveld <kris@gtk.org> Big TreeView DnD fixage, makes drops on empty models work, makes TreeStore DnD work and gets rid of gtk-tree-model-drop-append. Related bugs #95362 and #113314. I don't want to touch this code ever again. * gtk/gtktreeprivate.h (GtkTreePrivate): add empty_view_drop field. * gtk/gtktreednd.c (gtk_tree_get_row_drag_data): add check for selection_data->length. * gtk/gtktreeview.c (struct DestRow), (dest_row_free), (set_dest_row), (get_dest_row): we don't store just the row ref anymore, but a struct with the row ref and additional info, (set_destination_row): handle drops on empty space and some style fixes, (get_logical_dest_row): also return path_down_mode/drop_append_mode flags, handle dropping childs on their new parents, rewrite drop append handling into something saner, (gtk_tree_view_drag_motion): show a "drop possible arrow" on empty spaces, (gtk_tree_view_drag_drop): updates for updated backend, (gtk_tree_view_drag_data_received): updates for updated backend, path down mode (treestore DnD) handling, (gtk_tree_view_set_drag_dest_row): set empty_view_drop flag, when we are trying to drop a row on an empty model, (gtk_tree_view_get_drag_dest_row): handle empty_view_drop flag. * gtk/gtkliststore.c (gtk_list_store_drag_data_received), (gtk_list_store_row_drop_possible): style and drop-append fixes. * gtk/gtktreestore.c (gtk_tree_store_drag_data_received): ditto.
Diffstat (limited to 'gtk/gtktreestore.c')
-rw-r--r--gtk/gtktreestore.c29
1 files changed, 5 insertions, 24 deletions
diff --git a/gtk/gtktreestore.c b/gtk/gtktreestore.c
index 2f7b5963c2..65f3194bec 100644
--- a/gtk/gtktreestore.c
+++ b/gtk/gtktreestore.c
@@ -1754,7 +1754,7 @@ gtk_tree_store_drag_data_received (GtkTreeDragDest *drag_dest,
gtk_tree_path_free (parent);
parent = NULL;
- gtk_tree_store_prepend (GTK_TREE_STORE (tree_model),
+ gtk_tree_store_prepend (tree_store,
&dest_iter,
dest_parent_p);
@@ -1762,36 +1762,17 @@ gtk_tree_store_drag_data_received (GtkTreeDragDest *drag_dest,
}
else
{
- if (gtk_tree_model_get_iter (GTK_TREE_MODEL (tree_model),
- &dest_iter,
- prev))
+ if (gtk_tree_model_get_iter (tree_model, &dest_iter, prev))
{
GtkTreeIter tmp_iter = dest_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;
+ gtk_tree_store_insert_after (tree_store, &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,