diff options
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | ChangeLog.pre-2-0 | 10 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 10 | ||||
-rw-r--r-- | ChangeLog.pre-2-2 | 10 | ||||
-rw-r--r-- | ChangeLog.pre-2-4 | 10 | ||||
-rw-r--r-- | ChangeLog.pre-2-6 | 10 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 10 | ||||
-rw-r--r-- | gtk/gtkliststore.c | 12 | ||||
-rw-r--r-- | gtk/gtktreednd.c | 16 | ||||
-rw-r--r-- | gtk/gtktreednd.h | 29 | ||||
-rw-r--r-- | gtk/gtktreemodel.c | 21 | ||||
-rw-r--r-- | gtk/gtktreestore.c | 12 | ||||
-rw-r--r-- | gtk/gtktreeview.c | 12 |
13 files changed, 127 insertions, 45 deletions
@@ -1,3 +1,13 @@ +Wed Oct 31 16:53:48 2001 Jonathan Blandford <jrb@redhat.com> + + * gtk/gtktreednd.c (gtk_tree_set_row_drag_data): rename + gtk_selection_data_set_tree_row, #60218 + (gtk_tree_get_row_drag_data): rename + gtk_selection_data_get_tree_row, #60218 + + * gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): Actually + get this right, after the third try, #63122. + 2001-10-31 jacob berkman <jacob@ximian.com> * gdk/gdkselection.h (GDK_TARGET_STRING): diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 15d78f8f6a..081cf17180 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,13 @@ +Wed Oct 31 16:53:48 2001 Jonathan Blandford <jrb@redhat.com> + + * gtk/gtktreednd.c (gtk_tree_set_row_drag_data): rename + gtk_selection_data_set_tree_row, #60218 + (gtk_tree_get_row_drag_data): rename + gtk_selection_data_get_tree_row, #60218 + + * gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): Actually + get this right, after the third try, #63122. + 2001-10-31 jacob berkman <jacob@ximian.com> * gdk/gdkselection.h (GDK_TARGET_STRING): diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 15d78f8f6a..081cf17180 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,13 @@ +Wed Oct 31 16:53:48 2001 Jonathan Blandford <jrb@redhat.com> + + * gtk/gtktreednd.c (gtk_tree_set_row_drag_data): rename + gtk_selection_data_set_tree_row, #60218 + (gtk_tree_get_row_drag_data): rename + gtk_selection_data_get_tree_row, #60218 + + * gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): Actually + get this right, after the third try, #63122. + 2001-10-31 jacob berkman <jacob@ximian.com> * gdk/gdkselection.h (GDK_TARGET_STRING): diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 15d78f8f6a..081cf17180 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,13 @@ +Wed Oct 31 16:53:48 2001 Jonathan Blandford <jrb@redhat.com> + + * gtk/gtktreednd.c (gtk_tree_set_row_drag_data): rename + gtk_selection_data_set_tree_row, #60218 + (gtk_tree_get_row_drag_data): rename + gtk_selection_data_get_tree_row, #60218 + + * gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): Actually + get this right, after the third try, #63122. + 2001-10-31 jacob berkman <jacob@ximian.com> * gdk/gdkselection.h (GDK_TARGET_STRING): diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 15d78f8f6a..081cf17180 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,13 @@ +Wed Oct 31 16:53:48 2001 Jonathan Blandford <jrb@redhat.com> + + * gtk/gtktreednd.c (gtk_tree_set_row_drag_data): rename + gtk_selection_data_set_tree_row, #60218 + (gtk_tree_get_row_drag_data): rename + gtk_selection_data_get_tree_row, #60218 + + * gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): Actually + get this right, after the third try, #63122. + 2001-10-31 jacob berkman <jacob@ximian.com> * gdk/gdkselection.h (GDK_TARGET_STRING): diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 15d78f8f6a..081cf17180 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,13 @@ +Wed Oct 31 16:53:48 2001 Jonathan Blandford <jrb@redhat.com> + + * gtk/gtktreednd.c (gtk_tree_set_row_drag_data): rename + gtk_selection_data_set_tree_row, #60218 + (gtk_tree_get_row_drag_data): rename + gtk_selection_data_get_tree_row, #60218 + + * gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): Actually + get this right, after the third try, #63122. + 2001-10-31 jacob berkman <jacob@ximian.com> * gdk/gdkselection.h (GDK_TARGET_STRING): diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 15d78f8f6a..081cf17180 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,13 @@ +Wed Oct 31 16:53:48 2001 Jonathan Blandford <jrb@redhat.com> + + * gtk/gtktreednd.c (gtk_tree_set_row_drag_data): rename + gtk_selection_data_set_tree_row, #60218 + (gtk_tree_get_row_drag_data): rename + gtk_selection_data_get_tree_row, #60218 + + * gtk/gtktreemodel.c (gtk_tree_row_ref_deleted_callback): Actually + get this right, after the third try, #63122. + 2001-10-31 jacob berkman <jacob@ximian.com> * gdk/gdkselection.h (GDK_TARGET_STRING): diff --git a/gtk/gtkliststore.c b/gtk/gtkliststore.c index 77c1df072b..ebb6fd2a33 100644 --- a/gtk/gtkliststore.c +++ b/gtk/gtkliststore.c @@ -1278,9 +1278,9 @@ gtk_list_store_drag_data_get (GtkTreeDragSource *drag_source, * default handler. */ - if (gtk_selection_data_set_tree_row (selection_data, - GTK_TREE_MODEL (drag_source), - path)) + if (gtk_tree_set_row_drag_data (selection_data, + GTK_TREE_MODEL (drag_source), + path)) { return TRUE; } @@ -1308,9 +1308,9 @@ gtk_list_store_drag_data_received (GtkTreeDragDest *drag_dest, tree_model = GTK_TREE_MODEL (drag_dest); list_store = GTK_LIST_STORE (drag_dest); - if (gtk_selection_data_get_tree_row (selection_data, - &src_model, - &src_path) && + if (gtk_tree_get_row_drag_data (selection_data, + &src_model, + &src_path) && src_model == tree_model) { /* Copy the given row to a new position */ diff --git a/gtk/gtktreednd.c b/gtk/gtktreednd.c index bdf9e4abde..8f1cd7b3af 100644 --- a/gtk/gtktreednd.c +++ b/gtk/gtktreednd.c @@ -196,7 +196,7 @@ struct _TreeRowData }; /** - * gtk_selection_data_set_tree_row: + * gtk_tree_set_row_drag_data: * @selection_data: some #GtkSelectionData * @tree_model: a #GtkTreeModel * @path: a row in @tree_model @@ -207,9 +207,9 @@ struct _TreeRowData * Return value: %TRUE if the #GtkSelectionData had the proper target type to allow us to set a tree row **/ gboolean -gtk_selection_data_set_tree_row (GtkSelectionData *selection_data, - GtkTreeModel *tree_model, - GtkTreePath *path) +gtk_tree_set_row_drag_data (GtkSelectionData *selection_data, + GtkTreeModel *tree_model, + GtkTreePath *path) { TreeRowData *trd; gchar *path_str; @@ -249,7 +249,7 @@ gtk_selection_data_set_tree_row (GtkSelectionData *selection_data, } /** - * gtk_selection_data_get_tree_row: + * gtk_tree_get_row_drag_data: * @selection_data: a #GtkSelectionData * @tree_model: a #GtkTreeModel * @path: row in @tree_model @@ -268,9 +268,9 @@ gtk_selection_data_set_tree_row (GtkSelectionData *selection_data, * is otherwise valid **/ gboolean -gtk_selection_data_get_tree_row (GtkSelectionData *selection_data, - GtkTreeModel **tree_model, - GtkTreePath **path) +gtk_tree_get_row_drag_data (GtkSelectionData *selection_data, + GtkTreeModel **tree_model, + GtkTreePath **path) { TreeRowData *trd; diff --git a/gtk/gtktreednd.h b/gtk/gtktreednd.h index 8e9513ec24..fe1373ebfe 100644 --- a/gtk/gtktreednd.h +++ b/gtk/gtktreednd.h @@ -91,25 +91,28 @@ GType gtk_tree_drag_dest_get_type (void) G_GNUC_CONST; /* Inserts a row before dest which contains data in selection_data, * or returns FALSE if it can't */ -gboolean gtk_tree_drag_dest_drag_data_received (GtkTreeDragDest *drag_dest, - GtkTreePath *dest, - GtkSelectionData *selection_data); +gboolean gtk_tree_drag_dest_drag_data_received (GtkTreeDragDest *drag_dest, + GtkTreePath *dest, + GtkSelectionData *selection_data); + /* Returns TRUE if we can drop before path; path may not exist. */ -gboolean gtk_tree_drag_dest_row_drop_possible (GtkTreeDragDest *drag_dest, - GtkTreeModel *src_model, - GtkTreePath *src_path, - GtkTreePath *dest_path); +gboolean gtk_tree_drag_dest_row_drop_possible (GtkTreeDragDest *drag_dest, + GtkTreeModel *src_model, + GtkTreePath *src_path, + GtkTreePath *dest_path); + /* The selection data would normally have target type GTK_TREE_MODEL_ROW in this * case. If the target is wrong these functions return FALSE. */ -gboolean gtk_selection_data_set_tree_row (GtkSelectionData *selection_data, - GtkTreeModel *tree_model, - GtkTreePath *path); -gboolean gtk_selection_data_get_tree_row (GtkSelectionData *selection_data, - GtkTreeModel **tree_model, - GtkTreePath **path); +gboolean gtk_tree_set_row_drag_data (GtkSelectionData *selection_data, + GtkTreeModel *tree_model, + GtkTreePath *path); +gboolean gtk_tree_get_row_drag_data (GtkSelectionData *selection_data, + GtkTreeModel **tree_model, + GtkTreePath **path); + #ifdef __cplusplus } diff --git a/gtk/gtktreemodel.c b/gtk/gtktreemodel.c index 2ec1882858..1fdb0c84d6 100644 --- a/gtk/gtktreemodel.c +++ b/gtk/gtktreemodel.c @@ -397,7 +397,7 @@ gtk_tree_path_compare (const GtkTreePath *a, * @path: a #GtkTreePath * @descendant: another #GtkTreePath * - * + * Returns %TRUE is @descendant is a descendant of @path. * * Return value: %TRUE if @descendant is contained inside @path **/ @@ -1303,16 +1303,25 @@ gtk_tree_row_ref_deleted_callback (GObject *object, if (reference->path) { - if (gtk_tree_path_is_ancestor (path, reference->path)) - { - reference->path->indices[path->depth-1]-=1; - } - else if (gtk_tree_path_compare (path, reference->path) == 0) + gint i; + + if (path->depth > reference->path->depth) + continue; + for (i = 0; i < path->depth - 1; i++) + if (path->indices[i] != reference->path->indices[i]) + continue; + + /* We know it affects us. */ + if (path->indices[i] == reference->path->indices[i]) { gtk_tree_row_reference_unref_path (reference->path, reference->model, FALSE); gtk_tree_path_free (reference->path); reference->path = NULL; } + else if (path->indices[i] < reference->path->indices[i]) + { + reference->path->indices[path->depth-1]-=1; + } } tmp_list = g_slist_next (tmp_list); } diff --git a/gtk/gtktreestore.c b/gtk/gtktreestore.c index 0d6dc18123..85049b1fe3 100644 --- a/gtk/gtktreestore.c +++ b/gtk/gtktreestore.c @@ -1390,9 +1390,9 @@ gtk_tree_store_drag_data_get (GtkTreeDragSource *drag_source, * default handler. */ - if (gtk_selection_data_set_tree_row (selection_data, - GTK_TREE_MODEL (drag_source), - path)) + if (gtk_tree_set_row_drag_data (selection_data, + GTK_TREE_MODEL (drag_source), + path)) { return TRUE; } @@ -1492,9 +1492,9 @@ gtk_tree_store_drag_data_received (GtkTreeDragDest *drag_dest, validate_tree (tree_store); - if (gtk_selection_data_get_tree_row (selection_data, - &src_model, - &src_path) && + if (gtk_tree_get_row_drag_data (selection_data, + &src_model, + &src_path) && src_model == tree_model) { /* Copy the given row to a new position */ diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index ca7c336b9f..402c317bb9 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -3581,9 +3581,9 @@ gtk_tree_view_drag_data_get (GtkWidget *widget, /* If drag_data_get does nothing, try providing row data. */ if (selection_data->target == gdk_atom_intern ("GTK_TREE_MODEL_ROW", FALSE)) { - gtk_selection_data_set_tree_row (selection_data, - model, - source_row); + gtk_tree_set_row_drag_data (selection_data, + model, + source_row); } done: @@ -3809,9 +3809,9 @@ gtk_tree_view_drag_data_received (GtkWidget *widget, GtkTreeModel *src_model = NULL; GtkTreePath *src_path = NULL; - if (!gtk_selection_data_get_tree_row (selection_data, - &src_model, - &src_path)) + if (!gtk_tree_get_row_drag_data (selection_data, + &src_model, + &src_path)) suggested_action = 0; if (suggested_action) |