mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-09 18:30:08 +00:00
Revert "Add length to gtk_tree_path_get_indices"
This reverts commit eebb16eb1a
.
Was an accidental commit.
This commit is contained in:
parent
17f8b5e581
commit
905f988166
@ -744,7 +744,7 @@ gtk_combo_box_class_init (GtkComboBoxClass *klass)
|
||||
* The item which is currently active. If the model is a non-flat treemodel,
|
||||
* and the active item is not an immediate child of the root of the tree,
|
||||
* this property has the value
|
||||
* <literal>gtk_tree_path_get_indices (path, NULL)[0]</literal>,
|
||||
* <literal>gtk_tree_path_get_indices (path)[0]</literal>,
|
||||
* where <literal>path</literal> is the #GtkTreePath of the active item.
|
||||
*
|
||||
* Since: 2.4
|
||||
@ -1836,7 +1836,7 @@ gtk_combo_box_menu_popup (GtkComboBox *combo_box,
|
||||
if (gtk_tree_row_reference_valid (priv->active_row))
|
||||
{
|
||||
path = gtk_tree_row_reference_get_path (priv->active_row);
|
||||
active_item = gtk_tree_path_get_indices (path, NULL)[0];
|
||||
active_item = gtk_tree_path_get_indices (path)[0];
|
||||
gtk_tree_path_free (path);
|
||||
|
||||
if (priv->add_tearoffs)
|
||||
@ -3552,7 +3552,7 @@ gtk_combo_box_menu_row_inserted (GtkTreeModel *model,
|
||||
return;
|
||||
|
||||
depth = gtk_tree_path_get_depth (path);
|
||||
pos = gtk_tree_path_get_indices (path, NULL)[depth - 1];
|
||||
pos = gtk_tree_path_get_indices (path)[depth - 1];
|
||||
if (depth > 1)
|
||||
{
|
||||
ppath = gtk_tree_path_copy (path);
|
||||
@ -4901,7 +4901,7 @@ gtk_combo_box_set_column_span_column (GtkComboBox *combo_box,
|
||||
* Returns the index of the currently active item, or -1 if there's no
|
||||
* active item. If the model is a non-flat treemodel, and the active item
|
||||
* is not an immediate child of the root of the tree, this function returns
|
||||
* <literal>gtk_tree_path_get_indices (path, NULL)[0]</literal>, where
|
||||
* <literal>gtk_tree_path_get_indices (path)[0]</literal>, where
|
||||
* <literal>path</literal> is the #GtkTreePath of the active item.
|
||||
*
|
||||
* Return value: An integer which is the index of the currently active item,
|
||||
@ -4924,7 +4924,7 @@ gtk_combo_box_get_active (GtkComboBox *combo_box)
|
||||
GtkTreePath *path;
|
||||
|
||||
path = gtk_tree_row_reference_get_path (priv->active_row);
|
||||
result = gtk_tree_path_get_indices (path, NULL)[0];
|
||||
result = gtk_tree_path_get_indices (path)[0];
|
||||
gtk_tree_path_free (path);
|
||||
}
|
||||
else
|
||||
@ -5030,7 +5030,7 @@ gtk_combo_box_set_active_internal (GtkComboBox *combo_box,
|
||||
{
|
||||
/* FIXME handle nested menus better */
|
||||
gtk_menu_set_active (GTK_MENU (priv->popup_widget),
|
||||
gtk_tree_path_get_indices (path, NULL)[0]);
|
||||
gtk_tree_path_get_indices (path)[0]);
|
||||
}
|
||||
|
||||
if (priv->cell_view)
|
||||
|
@ -9474,7 +9474,7 @@ keypress_completion_out:
|
||||
|
||||
path = gtk_tree_path_new_from_indices (completion->priv->current_selected - matches, -1);
|
||||
g_signal_emit_by_name (completion, "action-activated",
|
||||
gtk_tree_path_get_indices (path, NULL)[0]);
|
||||
gtk_tree_path_get_indices (path)[0]);
|
||||
gtk_tree_path_free (path);
|
||||
}
|
||||
else
|
||||
|
@ -920,7 +920,7 @@ gtk_entry_completion_action_button_press (GtkWidget *widget,
|
||||
&path, NULL, NULL, NULL))
|
||||
{
|
||||
g_signal_emit (completion, entry_completion_signals[ACTION_ACTIVATED],
|
||||
0, gtk_tree_path_get_indices (path, NULL)[0]);
|
||||
0, gtk_tree_path_get_indices (path)[0]);
|
||||
gtk_tree_path_free (path);
|
||||
|
||||
_gtk_entry_completion_popdown (completion);
|
||||
|
@ -1439,7 +1439,7 @@ get_file_info_finished (GCancellable *cancellable,
|
||||
/* Handle doesn't exist anymore in the model */
|
||||
goto out;
|
||||
|
||||
pos = gtk_tree_path_get_indices (path, NULL)[0];
|
||||
pos = gtk_tree_path_get_indices (path)[0];
|
||||
gtk_tree_model_get_iter (GTK_TREE_MODEL (request->impl->shortcuts_model),
|
||||
&iter, path);
|
||||
gtk_tree_path_free (path);
|
||||
@ -2237,7 +2237,7 @@ shortcuts_pane_filter_cb (GtkTreeModel *model,
|
||||
if (!path)
|
||||
return FALSE;
|
||||
|
||||
pos = *gtk_tree_path_get_indices (path, NULL);
|
||||
pos = *gtk_tree_path_get_indices (path);
|
||||
gtk_tree_path_free (path);
|
||||
|
||||
return (pos < shortcuts_get_index (impl, SHORTCUTS_CURRENT_FOLDER_SEPARATOR));
|
||||
@ -3166,7 +3166,7 @@ shortcuts_compute_drop_position (GtkFileChooserDefault *impl,
|
||||
return;
|
||||
}
|
||||
|
||||
row = *gtk_tree_path_get_indices (*path, NULL);
|
||||
row = *gtk_tree_path_get_indices (*path);
|
||||
gtk_tree_view_get_background_area (tree_view, *path, column, &cell);
|
||||
gtk_tree_path_free (*path);
|
||||
|
||||
@ -3317,7 +3317,7 @@ shortcuts_reorder (GtkFileChooserDefault *impl,
|
||||
g_assert_not_reached ();
|
||||
|
||||
path = gtk_tree_model_get_path (GTK_TREE_MODEL (impl->shortcuts_model), &iter);
|
||||
old_position = *gtk_tree_path_get_indices (path, NULL);
|
||||
old_position = *gtk_tree_path_get_indices (path);
|
||||
gtk_tree_path_free (path);
|
||||
|
||||
bookmarks_index = shortcuts_get_index (impl, SHORTCUTS_BOOKMARKS);
|
||||
@ -3383,7 +3383,7 @@ shortcuts_drag_data_received_cb (GtkWidget *widget,
|
||||
bookmarks_index = shortcuts_get_index (impl, SHORTCUTS_BOOKMARKS);
|
||||
|
||||
shortcuts_compute_drop_position (impl, x, y, &tree_path, &tree_pos);
|
||||
position = *gtk_tree_path_get_indices (tree_path, NULL);
|
||||
position = *gtk_tree_path_get_indices (tree_path);
|
||||
gtk_tree_path_free (tree_path);
|
||||
|
||||
if (tree_pos == GTK_TREE_VIEW_DROP_AFTER)
|
||||
@ -4681,7 +4681,7 @@ shortcuts_combo_filter_func (GtkTreeModel *model,
|
||||
tree_path = gtk_tree_model_get_path (GTK_TREE_MODEL (impl->shortcuts_model), iter);
|
||||
g_assert (tree_path != NULL);
|
||||
|
||||
indices = gtk_tree_path_get_indices (tree_path, NULL);
|
||||
indices = gtk_tree_path_get_indices (tree_path);
|
||||
|
||||
retval = TRUE;
|
||||
|
||||
@ -10293,7 +10293,7 @@ shortcuts_pane_model_filter_row_draggable (GtkTreeDragSource *drag_source,
|
||||
|
||||
model = SHORTCUTS_PANE_MODEL_FILTER (drag_source);
|
||||
|
||||
pos = *gtk_tree_path_get_indices (path, NULL);
|
||||
pos = *gtk_tree_path_get_indices (path);
|
||||
bookmarks_pos = shortcuts_get_index (model->impl, SHORTCUTS_BOOKMARKS);
|
||||
|
||||
return (pos >= bookmarks_pos && pos < bookmarks_pos + model->impl->num_bookmarks);
|
||||
|
@ -516,7 +516,7 @@ gtk_file_system_model_get_iter (GtkTreeModel *tree_model,
|
||||
return gtk_file_system_model_iter_nth_child (tree_model,
|
||||
iter,
|
||||
NULL,
|
||||
gtk_tree_path_get_indices (path, NULL)[0]);
|
||||
gtk_tree_path_get_indices (path)[0]);
|
||||
}
|
||||
|
||||
static GtkTreePath *
|
||||
|
@ -1572,7 +1572,7 @@ gtk_icon_view_expose (GtkWidget *widget,
|
||||
|
||||
if (path)
|
||||
{
|
||||
dest_index = gtk_tree_path_get_indices (path, NULL)[0];
|
||||
dest_index = gtk_tree_path_get_indices (path)[0];
|
||||
gtk_tree_path_free (path);
|
||||
}
|
||||
else
|
||||
@ -2035,7 +2035,7 @@ gtk_icon_view_set_cursor (GtkIconView *icon_view,
|
||||
|
||||
if (gtk_tree_path_get_depth (path) == 1)
|
||||
item = g_list_nth_data (icon_view->priv->items,
|
||||
gtk_tree_path_get_indices(path, NULL)[0]);
|
||||
gtk_tree_path_get_indices(path)[0]);
|
||||
|
||||
if (!item)
|
||||
return;
|
||||
@ -3355,7 +3355,7 @@ gtk_icon_view_queue_draw_path (GtkIconView *icon_view,
|
||||
GList *l;
|
||||
gint index;
|
||||
|
||||
index = gtk_tree_path_get_indices (path, NULL)[0];
|
||||
index = gtk_tree_path_get_indices (path)[0];
|
||||
|
||||
for (l = icon_view->priv->items; l; l = l->next)
|
||||
{
|
||||
@ -3616,7 +3616,7 @@ gtk_icon_view_row_changed (GtkTreeModel *model,
|
||||
|
||||
gtk_icon_view_stop_editing (icon_view, TRUE);
|
||||
|
||||
index = gtk_tree_path_get_indices(path, NULL)[0];
|
||||
index = gtk_tree_path_get_indices(path)[0];
|
||||
item = g_list_nth_data (icon_view->priv->items, index);
|
||||
|
||||
gtk_icon_view_item_invalidate_size (item);
|
||||
@ -3641,7 +3641,7 @@ gtk_icon_view_row_inserted (GtkTreeModel *model,
|
||||
|
||||
iters_persist = gtk_tree_model_get_flags (icon_view->priv->model) & GTK_TREE_MODEL_ITERS_PERSIST;
|
||||
|
||||
index = gtk_tree_path_get_indices(path, NULL)[0];
|
||||
index = gtk_tree_path_get_indices(path)[0];
|
||||
|
||||
item = gtk_icon_view_item_new ();
|
||||
|
||||
@ -3683,7 +3683,7 @@ gtk_icon_view_row_deleted (GtkTreeModel *model,
|
||||
|
||||
icon_view = GTK_ICON_VIEW (data);
|
||||
|
||||
index = gtk_tree_path_get_indices(path, NULL)[0];
|
||||
index = gtk_tree_path_get_indices(path)[0];
|
||||
|
||||
list = g_list_nth (icon_view->priv->items, index);
|
||||
item = list->data;
|
||||
@ -4396,7 +4396,7 @@ gtk_icon_view_scroll_to_path (GtkIconView *icon_view,
|
||||
|
||||
if (gtk_tree_path_get_depth (path) > 0)
|
||||
item = g_list_nth_data (icon_view->priv->items,
|
||||
gtk_tree_path_get_indices(path, NULL)[0]);
|
||||
gtk_tree_path_get_indices(path)[0]);
|
||||
|
||||
if (!item || item->width < 0 ||
|
||||
!gtk_widget_get_realized (GTK_WIDGET (icon_view)))
|
||||
@ -4967,7 +4967,7 @@ gtk_icon_view_set_tooltip_cell (GtkIconView *icon_view,
|
||||
|
||||
if (gtk_tree_path_get_depth (path) > 0)
|
||||
item = g_list_nth_data (icon_view->priv->items,
|
||||
gtk_tree_path_get_indices(path, NULL)[0]);
|
||||
gtk_tree_path_get_indices(path)[0]);
|
||||
|
||||
if (!item)
|
||||
return;
|
||||
@ -5788,7 +5788,7 @@ gtk_icon_view_select_path (GtkIconView *icon_view,
|
||||
|
||||
if (gtk_tree_path_get_depth (path) > 0)
|
||||
item = g_list_nth_data (icon_view->priv->items,
|
||||
gtk_tree_path_get_indices(path, NULL)[0]);
|
||||
gtk_tree_path_get_indices(path)[0]);
|
||||
|
||||
if (item)
|
||||
gtk_icon_view_select_item (icon_view, item);
|
||||
@ -5814,7 +5814,7 @@ gtk_icon_view_unselect_path (GtkIconView *icon_view,
|
||||
g_return_if_fail (path != NULL);
|
||||
|
||||
item = g_list_nth_data (icon_view->priv->items,
|
||||
gtk_tree_path_get_indices(path, NULL)[0]);
|
||||
gtk_tree_path_get_indices(path)[0]);
|
||||
|
||||
if (!item)
|
||||
return;
|
||||
@ -5947,7 +5947,7 @@ gtk_icon_view_path_is_selected (GtkIconView *icon_view,
|
||||
g_return_val_if_fail (path != NULL, FALSE);
|
||||
|
||||
item = g_list_nth_data (icon_view->priv->items,
|
||||
gtk_tree_path_get_indices(path, NULL)[0]);
|
||||
gtk_tree_path_get_indices(path)[0]);
|
||||
|
||||
if (!item)
|
||||
return FALSE;
|
||||
@ -5978,7 +5978,7 @@ gtk_icon_view_get_item_row (GtkIconView *icon_view,
|
||||
g_return_val_if_fail (path != NULL, FALSE);
|
||||
|
||||
item = g_list_nth_data (icon_view->priv->items,
|
||||
gtk_tree_path_get_indices(path, NULL)[0]);
|
||||
gtk_tree_path_get_indices(path)[0]);
|
||||
|
||||
if (!item)
|
||||
return -1;
|
||||
@ -6009,7 +6009,7 @@ gtk_icon_view_get_item_column (GtkIconView *icon_view,
|
||||
g_return_val_if_fail (path != NULL, FALSE);
|
||||
|
||||
item = g_list_nth_data (icon_view->priv->items,
|
||||
gtk_tree_path_get_indices(path, NULL)[0]);
|
||||
gtk_tree_path_get_indices(path)[0]);
|
||||
|
||||
if (!item)
|
||||
return -1;
|
||||
@ -7325,7 +7325,7 @@ gtk_icon_view_set_drag_dest_item (GtkIconView *icon_view,
|
||||
icon_view->priv->empty_view_drop = FALSE;
|
||||
if (pos == GTK_ICON_VIEW_DROP_ABOVE && path
|
||||
&& gtk_tree_path_get_depth (path) == 1
|
||||
&& gtk_tree_path_get_indices (path, NULL)[0] == 0)
|
||||
&& gtk_tree_path_get_indices (path)[0] == 0)
|
||||
{
|
||||
gint n_children;
|
||||
|
||||
@ -7472,7 +7472,7 @@ gtk_icon_view_create_drag_icon (GtkIconView *icon_view,
|
||||
if (!gtk_widget_get_realized (widget))
|
||||
return NULL;
|
||||
|
||||
index = gtk_tree_path_get_indices (path, NULL)[0];
|
||||
index = gtk_tree_path_get_indices (path)[0];
|
||||
|
||||
for (l = icon_view->priv->items; l; l = l->next)
|
||||
{
|
||||
@ -9184,7 +9184,7 @@ gtk_icon_view_accessible_model_row_changed (GtkTreeModel *tree_model,
|
||||
|
||||
atk_obj = gtk_widget_get_accessible (GTK_WIDGET (user_data));
|
||||
a11y_view = GTK_ICON_VIEW_ACCESSIBLE (atk_obj);
|
||||
index = gtk_tree_path_get_indices(path, NULL)[0];
|
||||
index = gtk_tree_path_get_indices(path)[0];
|
||||
a11y_item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (
|
||||
gtk_icon_view_accessible_find_child (atk_obj, index));
|
||||
|
||||
@ -9228,7 +9228,7 @@ gtk_icon_view_accessible_model_row_inserted (GtkTreeModel *tree_model,
|
||||
AtkObject *atk_obj;
|
||||
gint index;
|
||||
|
||||
index = gtk_tree_path_get_indices(path, NULL)[0];
|
||||
index = gtk_tree_path_get_indices(path)[0];
|
||||
atk_obj = gtk_widget_get_accessible (GTK_WIDGET (user_data));
|
||||
view = GTK_ICON_VIEW_ACCESSIBLE (atk_obj);
|
||||
priv = gtk_icon_view_accessible_get_priv (atk_obj);
|
||||
@ -9273,7 +9273,7 @@ gtk_icon_view_accessible_model_row_deleted (GtkTreeModel *tree_model,
|
||||
AtkObject *atk_obj;
|
||||
gint index;
|
||||
|
||||
index = gtk_tree_path_get_indices(path, NULL)[0];
|
||||
index = gtk_tree_path_get_indices(path)[0];
|
||||
atk_obj = gtk_widget_get_accessible (GTK_WIDGET (user_data));
|
||||
view = GTK_ICON_VIEW_ACCESSIBLE (atk_obj);
|
||||
priv = gtk_icon_view_accessible_get_priv (atk_obj);
|
||||
|
@ -435,7 +435,7 @@ gtk_list_store_get_iter (GtkTreeModel *tree_model,
|
||||
|
||||
seq = list_store->seq;
|
||||
|
||||
i = gtk_tree_path_get_indices (path, NULL)[0];
|
||||
i = gtk_tree_path_get_indices (path)[0];
|
||||
|
||||
if (i >= g_sequence_get_length (seq))
|
||||
return FALSE;
|
||||
@ -1388,7 +1388,7 @@ gtk_list_store_row_drop_possible (GtkTreeDragDest *drag_dest,
|
||||
|
||||
/* can drop before any existing node, or before one past any existing. */
|
||||
|
||||
indices = gtk_tree_path_get_indices (dest_path, NULL);
|
||||
indices = gtk_tree_path_get_indices (dest_path);
|
||||
|
||||
if (indices[0] <= g_sequence_get_length (GTK_LIST_STORE (drag_dest)->seq))
|
||||
retval = TRUE;
|
||||
|
@ -608,19 +608,36 @@ gtk_tree_path_get_depth (GtkTreePath *path)
|
||||
/**
|
||||
* gtk_tree_path_get_indices:
|
||||
* @path: A #GtkTreePath.
|
||||
* @depth: (allow-none): Number of elements returned in the integer array
|
||||
*
|
||||
* Returns the current indices of @path. This is an array of integers, each
|
||||
* representing a node in a tree. This value should not be freed.
|
||||
*
|
||||
* Return value: The current indices, or %NULL.
|
||||
**/
|
||||
gint *
|
||||
gtk_tree_path_get_indices (GtkTreePath *path)
|
||||
{
|
||||
g_return_val_if_fail (path != NULL, NULL);
|
||||
|
||||
return path->indices;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_tree_path_get_indices_with_depth:
|
||||
* @path: A #GtkTreePath.
|
||||
* @depth: Number of elements returned in the integer array
|
||||
*
|
||||
* Returns the current indices of @path.
|
||||
* This is an array of integers, each representing a node in a tree.
|
||||
* It also returns the number of elements in the array.
|
||||
* The array should not be freed.
|
||||
*
|
||||
* Return value: (transfer none) (array length=depth): The current indices, or %NULL.
|
||||
* Return value: (array length=depth): The current indices, or %NULL.
|
||||
*
|
||||
* Since: 3.0
|
||||
**/
|
||||
gint *
|
||||
gtk_tree_path_get_indices (GtkTreePath *path, gint *depth)
|
||||
gtk_tree_path_get_indices_with_depth (GtkTreePath *path, gint *depth)
|
||||
{
|
||||
g_return_val_if_fail (path != NULL, NULL);
|
||||
|
||||
@ -1837,7 +1854,7 @@ gtk_tree_row_ref_reordered (RowRefList *refs,
|
||||
if (ref_depth > depth)
|
||||
{
|
||||
gint i;
|
||||
gint *indices = gtk_tree_path_get_indices (reference->path, NULL);
|
||||
gint *indices = gtk_tree_path_get_indices (reference->path);
|
||||
|
||||
for (i = 0; i < length; i++)
|
||||
{
|
||||
|
@ -133,8 +133,10 @@ void gtk_tree_path_append_index (GtkTreePath *path,
|
||||
void gtk_tree_path_prepend_index (GtkTreePath *path,
|
||||
gint index_);
|
||||
gint gtk_tree_path_get_depth (GtkTreePath *path);
|
||||
gint *gtk_tree_path_get_indices (GtkTreePath *path,
|
||||
gint *depth);
|
||||
gint *gtk_tree_path_get_indices (GtkTreePath *path);
|
||||
|
||||
gint *gtk_tree_path_get_indices_with_depth (GtkTreePath *path,
|
||||
gint *depth);
|
||||
|
||||
void gtk_tree_path_free (GtkTreePath *path);
|
||||
GtkTreePath *gtk_tree_path_copy (const GtkTreePath *path);
|
||||
|
@ -722,7 +722,7 @@ gtk_tree_model_filter_add_root (GtkTreePath *src,
|
||||
retval = gtk_tree_path_copy (root);
|
||||
|
||||
for (i = 0; i < gtk_tree_path_get_depth (src); i++)
|
||||
gtk_tree_path_append_index (retval, gtk_tree_path_get_indices (src, NULL)[i]);
|
||||
gtk_tree_path_append_index (retval, gtk_tree_path_get_indices (src)[i]);
|
||||
|
||||
return retval;
|
||||
}
|
||||
@ -740,10 +740,10 @@ gtk_tree_model_filter_remove_root (GtkTreePath *src,
|
||||
return NULL;
|
||||
|
||||
depth = gtk_tree_path_get_depth (src);
|
||||
indices = gtk_tree_path_get_indices (src, NULL);
|
||||
indices = gtk_tree_path_get_indices (src);
|
||||
|
||||
for (i = 0; i < gtk_tree_path_get_depth (root); i++)
|
||||
if (indices[i] != gtk_tree_path_get_indices (root, NULL)[i])
|
||||
if (indices[i] != gtk_tree_path_get_indices (root)[i])
|
||||
return NULL;
|
||||
|
||||
retval = gtk_tree_path_new ();
|
||||
@ -1458,7 +1458,7 @@ gtk_tree_model_filter_row_inserted (GtkTreeModel *c_model,
|
||||
gboolean common_prefix = TRUE;
|
||||
|
||||
level = gtk_tree_path_get_depth (c_path) - 1;
|
||||
v_indices = gtk_tree_path_get_indices (filter->priv->virtual_root, NULL);
|
||||
v_indices = gtk_tree_path_get_indices (filter->priv->virtual_root);
|
||||
c_indices = gtk_tree_path_get_indices (c_path);
|
||||
|
||||
for (i = 0; i < level; i++)
|
||||
@ -1516,7 +1516,7 @@ gtk_tree_model_filter_row_inserted (GtkTreeModel *c_model,
|
||||
goto done;
|
||||
|
||||
elt = bsearch_elt_with_offset (level->array,
|
||||
gtk_tree_path_get_indices (real_path, NULL)[i],
|
||||
gtk_tree_path_get_indices (real_path)[i],
|
||||
&j);
|
||||
|
||||
if (!elt)
|
||||
@ -1556,7 +1556,7 @@ gtk_tree_model_filter_row_inserted (GtkTreeModel *c_model,
|
||||
goto done;
|
||||
|
||||
/* let's try to insert the value */
|
||||
offset = gtk_tree_path_get_indices (real_path, NULL)[gtk_tree_path_get_depth (real_path) - 1];
|
||||
offset = gtk_tree_path_get_indices (real_path)[gtk_tree_path_get_depth (real_path) - 1];
|
||||
|
||||
/* update the offsets, yes if we didn't insert the node above, there will
|
||||
* be a gap here. This will be filled with the node (via fetch_child) when
|
||||
@ -1807,7 +1807,7 @@ gtk_tree_model_filter_row_deleted (GtkTreeModel *c_model,
|
||||
gboolean common_prefix = TRUE;
|
||||
|
||||
level = gtk_tree_path_get_depth (c_path) - 1;
|
||||
v_indices = gtk_tree_path_get_indices (filter->priv->virtual_root, NULL);
|
||||
v_indices = gtk_tree_path_get_indices (filter->priv->virtual_root);
|
||||
c_indices = gtk_tree_path_get_indices (c_path);
|
||||
|
||||
for (i = 0; i < level; i++)
|
||||
@ -1868,7 +1868,7 @@ gtk_tree_model_filter_row_deleted (GtkTreeModel *c_model,
|
||||
}
|
||||
|
||||
elt = bsearch_elt_with_offset (level->array,
|
||||
gtk_tree_path_get_indices (real_path, NULL)[i],
|
||||
gtk_tree_path_get_indices (real_path)[i],
|
||||
&j);
|
||||
|
||||
if (!elt || !elt->children)
|
||||
@ -1883,7 +1883,7 @@ gtk_tree_model_filter_row_deleted (GtkTreeModel *c_model,
|
||||
}
|
||||
}
|
||||
|
||||
offset = gtk_tree_path_get_indices (real_path, NULL)[gtk_tree_path_get_depth (real_path) - 1];
|
||||
offset = gtk_tree_path_get_indices (real_path)[gtk_tree_path_get_depth (real_path) - 1];
|
||||
gtk_tree_path_free (real_path);
|
||||
|
||||
if (!level)
|
||||
@ -2026,13 +2026,13 @@ gtk_tree_model_filter_rows_reordered (GtkTreeModel *c_model,
|
||||
|
||||
/* reorder root level of path */
|
||||
for (i = 0; i < length; i++)
|
||||
if (new_order[i] == gtk_tree_path_get_indices (filter->priv->virtual_root, NULL)[0])
|
||||
if (new_order[i] == gtk_tree_path_get_indices (filter->priv->virtual_root)[0])
|
||||
new_pos = i;
|
||||
|
||||
if (new_pos < 0)
|
||||
return;
|
||||
|
||||
gtk_tree_path_get_indices (filter->priv->virtual_root, NULL)[0] = new_pos;
|
||||
gtk_tree_path_get_indices (filter->priv->virtual_root)[0] = new_pos;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2062,13 +2062,13 @@ gtk_tree_model_filter_rows_reordered (GtkTreeModel *c_model,
|
||||
length = gtk_tree_model_iter_n_children (c_model, &real_c_iter);
|
||||
|
||||
for (i = 0; i < length; i++)
|
||||
if (new_order[i] == gtk_tree_path_get_indices (filter->priv->virtual_root, NULL)[level])
|
||||
if (new_order[i] == gtk_tree_path_get_indices (filter->priv->virtual_root)[level])
|
||||
new_pos = i;
|
||||
|
||||
if (new_pos < 0)
|
||||
return;
|
||||
|
||||
gtk_tree_path_get_indices (filter->priv->virtual_root, NULL)[level] = new_pos;
|
||||
gtk_tree_path_get_indices (filter->priv->virtual_root)[level] = new_pos;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2164,7 +2164,7 @@ gtk_tree_model_filter_rows_reordered (GtkTreeModel *c_model,
|
||||
}
|
||||
|
||||
/* emit rows_reordered */
|
||||
if (!gtk_tree_path_get_indices (path, NULL))
|
||||
if (!gtk_tree_path_get_indices (path))
|
||||
gtk_tree_model_rows_reordered (GTK_TREE_MODEL (data), path, NULL,
|
||||
tmp_array);
|
||||
else
|
||||
@ -2258,7 +2258,7 @@ gtk_tree_model_filter_get_iter_full (GtkTreeModel *model,
|
||||
g_return_val_if_fail (GTK_IS_TREE_MODEL_FILTER (model), FALSE);
|
||||
g_return_val_if_fail (filter->priv->child_model != NULL, FALSE);
|
||||
|
||||
indices = gtk_tree_path_get_indices (path, NULL);
|
||||
indices = gtk_tree_path_get_indices (path);
|
||||
|
||||
if (filter->priv->root == NULL)
|
||||
gtk_tree_model_filter_build_level (filter, NULL, -1, FALSE);
|
||||
@ -2315,7 +2315,7 @@ gtk_tree_model_filter_get_iter (GtkTreeModel *model,
|
||||
g_return_val_if_fail (GTK_IS_TREE_MODEL_FILTER (model), FALSE);
|
||||
g_return_val_if_fail (filter->priv->child_model != NULL, FALSE);
|
||||
|
||||
indices = gtk_tree_path_get_indices (path, NULL);
|
||||
indices = gtk_tree_path_get_indices (path);
|
||||
|
||||
if (filter->priv->root == NULL)
|
||||
gtk_tree_model_filter_build_level (filter, NULL, -1, FALSE);
|
||||
@ -3287,7 +3287,7 @@ gtk_real_tree_model_filter_convert_child_path_to_path (GtkTreeModelFilter *filte
|
||||
return NULL;
|
||||
|
||||
retval = gtk_tree_path_new ();
|
||||
child_indices = gtk_tree_path_get_indices (real_path, NULL);
|
||||
child_indices = gtk_tree_path_get_indices (real_path);
|
||||
|
||||
if (filter->priv->root == NULL && build_levels)
|
||||
gtk_tree_model_filter_build_level (filter, NULL, -1, FALSE);
|
||||
@ -3426,7 +3426,7 @@ gtk_tree_model_filter_convert_path_to_child_path (GtkTreeModelFilter *filter,
|
||||
|
||||
/* convert path */
|
||||
retval = gtk_tree_path_new ();
|
||||
filter_indices = gtk_tree_path_get_indices (filter_path, NULL);
|
||||
filter_indices = gtk_tree_path_get_indices (filter_path);
|
||||
if (!filter->priv->root)
|
||||
gtk_tree_model_filter_build_level (filter, NULL, -1, FALSE);
|
||||
level = FILTER_LEVEL (filter->priv->root);
|
||||
|
@ -481,7 +481,7 @@ gtk_tree_store_get_iter (GtkTreeModel *tree_model,
|
||||
|
||||
tree_store->columns_dirty = TRUE;
|
||||
|
||||
indices = gtk_tree_path_get_indices (path, NULL);
|
||||
indices = gtk_tree_path_get_indices (path);
|
||||
depth = gtk_tree_path_get_depth (path);
|
||||
|
||||
g_return_val_if_fail (depth > 0, FALSE);
|
||||
@ -2467,7 +2467,7 @@ gtk_tree_store_move (GtkTreeStore *tree_store,
|
||||
{
|
||||
b = G_NODE (position->user_data);
|
||||
|
||||
if (gtk_tree_path_get_indices (pos_path, NULL)[gtk_tree_path_get_depth (pos_path) - 1] > 0)
|
||||
if (gtk_tree_path_get_indices (pos_path)[gtk_tree_path_get_depth (pos_path) - 1] > 0)
|
||||
{
|
||||
gtk_tree_path_prev (pos_path);
|
||||
if (gtk_tree_store_get_iter (GTK_TREE_MODEL (tree_store),
|
||||
@ -2611,7 +2611,7 @@ gtk_tree_store_move (GtkTreeStore *tree_store,
|
||||
|
||||
/* emit signal */
|
||||
if (position)
|
||||
new_pos = gtk_tree_path_get_indices (pos_path, NULL)[gtk_tree_path_get_depth (pos_path)-1];
|
||||
new_pos = gtk_tree_path_get_indices (pos_path)[gtk_tree_path_get_depth (pos_path)-1];
|
||||
else if (before)
|
||||
{
|
||||
if (depth)
|
||||
|
@ -7575,7 +7575,7 @@ gtk_tree_view_drag_data_received (GtkWidget *widget,
|
||||
time);
|
||||
|
||||
if (gtk_tree_path_get_depth (dest_row) == 1
|
||||
&& gtk_tree_path_get_indices (dest_row, NULL)[0] == 0)
|
||||
&& gtk_tree_path_get_indices (dest_row)[0] == 0)
|
||||
{
|
||||
/* special special case drag to "0", scroll to first item */
|
||||
if (!tree_view->priv->scroll_to_path)
|
||||
@ -8392,7 +8392,7 @@ gtk_tree_view_row_inserted (GtkTreeModel *model,
|
||||
/* Update all row-references */
|
||||
gtk_tree_row_reference_inserted (G_OBJECT (data), path);
|
||||
depth = gtk_tree_path_get_depth (path);
|
||||
indices = gtk_tree_path_get_indices (path, NULL);
|
||||
indices = gtk_tree_path_get_indices (path);
|
||||
|
||||
/* First, find the parent tree */
|
||||
while (i < depth - 1)
|
||||
@ -9025,7 +9025,7 @@ _gtk_tree_view_find_node (GtkTreeView *tree_view,
|
||||
{
|
||||
GtkRBNode *tmpnode = NULL;
|
||||
GtkRBTree *tmptree = tree_view->priv->tree;
|
||||
gint *indices = gtk_tree_path_get_indices (path, NULL);
|
||||
gint *indices = gtk_tree_path_get_indices (path);
|
||||
gint depth = gtk_tree_path_get_depth (path);
|
||||
gint i = 0;
|
||||
|
||||
@ -11989,7 +11989,7 @@ gtk_tree_view_collapse_all (GtkTreeView *tree_view)
|
||||
|
||||
path = gtk_tree_path_new ();
|
||||
gtk_tree_path_down (path);
|
||||
indices = gtk_tree_path_get_indices (path, NULL);
|
||||
indices = gtk_tree_path_get_indices (path);
|
||||
|
||||
tree = tree_view->priv->tree;
|
||||
node = tree->root;
|
||||
@ -12029,7 +12029,7 @@ gtk_tree_view_expand_to_path (GtkTreeView *tree_view,
|
||||
g_return_if_fail (path != NULL);
|
||||
|
||||
depth = gtk_tree_path_get_depth (path);
|
||||
indices = gtk_tree_path_get_indices (path, NULL);
|
||||
indices = gtk_tree_path_get_indices (path);
|
||||
|
||||
tmp = gtk_tree_path_new ();
|
||||
g_return_if_fail (tmp != NULL);
|
||||
@ -13484,7 +13484,7 @@ gtk_tree_view_set_drag_dest_row (GtkTreeView *tree_view,
|
||||
|
||||
if (pos == GTK_TREE_VIEW_DROP_BEFORE && path
|
||||
&& gtk_tree_path_get_depth (path) == 1
|
||||
&& gtk_tree_path_get_indices (path, NULL)[0] == 0)
|
||||
&& gtk_tree_path_get_indices (path)[0] == 0)
|
||||
{
|
||||
gint n_children;
|
||||
|
||||
|
@ -455,7 +455,7 @@ strip_virtual_root (GtkTreePath *path,
|
||||
|
||||
for (j = 0; j < depth - root_depth; j++)
|
||||
gtk_tree_path_append_index (real_path,
|
||||
gtk_tree_path_get_indices (path, NULL)[root_depth + j]);
|
||||
gtk_tree_path_get_indices (path)[root_depth + j]);
|
||||
}
|
||||
else
|
||||
real_path = gtk_tree_path_copy (path);
|
||||
@ -826,7 +826,7 @@ insert_path_with_visibility (FilterTest *fixture,
|
||||
GtkTreeIter parent, iter;
|
||||
|
||||
path = gtk_tree_path_new_from_string (path_string);
|
||||
position = gtk_tree_path_get_indices (path, NULL)[gtk_tree_path_get_depth (path)];
|
||||
position = gtk_tree_path_get_indices (path)[gtk_tree_path_get_depth (path)];
|
||||
gtk_tree_path_up (path);
|
||||
|
||||
if (gtk_tree_model_get_iter (GTK_TREE_MODEL (fixture->store), &parent, path))
|
||||
@ -1822,7 +1822,7 @@ specific_path_dependent_filter_func (GtkTreeModel *model,
|
||||
GtkTreePath *path;
|
||||
|
||||
path = gtk_tree_model_get_path (model, iter);
|
||||
if (gtk_tree_path_get_indices (path, NULL)[0] < 4)
|
||||
if (gtk_tree_path_get_indices (path)[0] < 4)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
|
@ -54,7 +54,7 @@ iter_position (GtkListStore *store,
|
||||
if (!path)
|
||||
return FALSE;
|
||||
|
||||
if (gtk_tree_path_get_indices (path, NULL)[0] != n)
|
||||
if (gtk_tree_path_get_indices (path)[0] != n)
|
||||
ret = FALSE;
|
||||
|
||||
gtk_tree_path_free (path);
|
||||
|
@ -57,7 +57,7 @@ iter_position (GtkTreeStore *store,
|
||||
if (!path)
|
||||
return FALSE;
|
||||
|
||||
if (gtk_tree_path_get_indices (path, NULL)[0] != n)
|
||||
if (gtk_tree_path_get_indices (path)[0] != n)
|
||||
ret = FALSE;
|
||||
|
||||
gtk_tree_path_free (path);
|
||||
|
@ -256,7 +256,7 @@ get_pos_from_path (GtkTreeView *tree_view,
|
||||
int row_start;
|
||||
|
||||
row_start = get_row_start_for_index (tree_view,
|
||||
gtk_tree_path_get_indices (path, NULL)[0]);
|
||||
gtk_tree_path_get_indices (path)[0]);
|
||||
|
||||
if (row_start + row_height < vadj->page_size)
|
||||
return POS_TOP;
|
||||
@ -406,7 +406,7 @@ test_position (GtkTreeView *tree_view,
|
||||
path, NULL, &rect);
|
||||
|
||||
row_start = get_row_start_for_index (GTK_TREE_VIEW (tree_view),
|
||||
gtk_tree_path_get_indices (path, NULL)[0]);
|
||||
gtk_tree_path_get_indices (path)[0]);
|
||||
|
||||
/* Ugh */
|
||||
pos = get_pos_from_path (GTK_TREE_VIEW (tree_view),
|
||||
|
@ -3257,7 +3257,7 @@ get_row_from_tree_path (GtkTreeView *tree_view,
|
||||
tree_model = gtk_tree_view_get_model (tree_view);
|
||||
|
||||
if (gtk_tree_model_get_flags (tree_model) & GTK_TREE_MODEL_LIST_ONLY)
|
||||
row = gtk_tree_path_get_indices (path, NULL)[0];
|
||||
row = gtk_tree_path_get_indices (path)[0];
|
||||
else
|
||||
{
|
||||
root_tree = gtk_tree_path_new_first ();
|
||||
@ -4360,7 +4360,7 @@ get_index (GtkTreeView *tree_view,
|
||||
if (path)
|
||||
{
|
||||
depth = gtk_tree_path_get_depth (path);
|
||||
indices = gtk_tree_path_get_indices (path, NULL);
|
||||
indices = gtk_tree_path_get_indices (path);
|
||||
}
|
||||
|
||||
if (depth > 1)
|
||||
|
@ -973,7 +973,7 @@ set_sensitive (GtkCellLayout *cell_layout,
|
||||
gboolean sensitive;
|
||||
|
||||
path = gtk_tree_model_get_path (tree_model, iter);
|
||||
indices = gtk_tree_path_get_indices (path, NULL);
|
||||
indices = gtk_tree_path_get_indices (path);
|
||||
sensitive = indices[0] != 1;
|
||||
gtk_tree_path_free (path);
|
||||
|
||||
@ -989,7 +989,7 @@ is_separator (GtkTreeModel *model,
|
||||
gboolean result;
|
||||
|
||||
path = gtk_tree_model_get_path (model, iter);
|
||||
result = gtk_tree_path_get_indices (path, NULL)[0] == 4;
|
||||
result = gtk_tree_path_get_indices (path)[0] == 4;
|
||||
gtk_tree_path_free (path);
|
||||
|
||||
return result;
|
||||
|
@ -69,7 +69,7 @@ visible_func (GtkTreeModel *model,
|
||||
|
||||
path = gtk_tree_model_get_path (model, iter);
|
||||
|
||||
if (gtk_tree_path_get_indices (path, NULL)[0] < 4)
|
||||
if (gtk_tree_path_get_indices (path)[0] < 4)
|
||||
visible = first;
|
||||
else
|
||||
visible = !first;
|
||||
|
@ -116,7 +116,7 @@ view_column_model_get_iter (GtkTreeModel *tree_model,
|
||||
|
||||
g_return_val_if_fail (gtk_tree_path_get_depth (path) > 0, FALSE);
|
||||
|
||||
i = gtk_tree_path_get_indices (path, NULL)[0];
|
||||
i = gtk_tree_path_get_indices (path)[0];
|
||||
list = g_list_nth (view_model->columns, i);
|
||||
|
||||
if (list == NULL)
|
||||
@ -659,7 +659,7 @@ move_to_right (GtkTreeIter *src_iter,
|
||||
if (dest_iter)
|
||||
{
|
||||
GtkTreePath *path = gtk_tree_model_get_path (dest, dest_iter);
|
||||
before = (gtk_tree_path_get_indices (path, NULL))[0];
|
||||
before = (gtk_tree_path_get_indices (path))[0];
|
||||
gtk_tree_path_free (path);
|
||||
}
|
||||
|
||||
@ -686,7 +686,7 @@ move_up_or_down (GtkTreeModel *src,
|
||||
if (dest_iter)
|
||||
{
|
||||
GtkTreePath *path = gtk_tree_model_get_path (dest, dest_iter);
|
||||
before = (gtk_tree_path_get_indices (path, NULL))[0];
|
||||
before = (gtk_tree_path_get_indices (path))[0];
|
||||
gtk_tree_path_free (path);
|
||||
}
|
||||
|
||||
|
@ -330,7 +330,7 @@ set_indicator_size (GtkTreeViewColumn *column,
|
||||
GtkTreePath *path;
|
||||
|
||||
path = gtk_tree_model_get_path (model, iter);
|
||||
size = gtk_tree_path_get_indices (path, NULL)[0] * 2 + 10;
|
||||
size = gtk_tree_path_get_indices (path)[0] * 2 + 10;
|
||||
gtk_tree_path_free (path);
|
||||
|
||||
g_object_set (cell, "indicator_size", size, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user