mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 10:50:10 +00:00
Rename gtk_tree_path_new_from_node() to tree_path_new_from_node()
This is a function internal to the file system model; let's not pollute the gtk_tree_path namespace. Also, make the 'i' variable into 'r' as it refers to a row index, not a file-array index (for consistency with the docs and the rest of the code). Signed-off-by: Federico Mena Quintero <federico@gnome.org>
This commit is contained in:
parent
f0a211a1df
commit
281c592ea9
@ -263,13 +263,13 @@ node_invalidate_index (GtkFileSystemModel *model, guint id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static GtkTreePath *
|
static GtkTreePath *
|
||||||
gtk_tree_path_new_from_node (GtkFileSystemModel *model, guint id)
|
tree_path_new_from_node (GtkFileSystemModel *model, guint id)
|
||||||
{
|
{
|
||||||
guint i = node_get_tree_row (model, id);
|
guint r = node_get_tree_row (model, id);
|
||||||
|
|
||||||
g_assert (i < model->files->len);
|
g_assert (r < model->files->len);
|
||||||
|
|
||||||
return gtk_tree_path_new_from_indices (i, -1);
|
return gtk_tree_path_new_from_indices (r, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -278,7 +278,7 @@ emit_row_inserted_for_node (GtkFileSystemModel *model, guint id)
|
|||||||
GtkTreePath *path;
|
GtkTreePath *path;
|
||||||
GtkTreeIter iter;
|
GtkTreeIter iter;
|
||||||
|
|
||||||
path = gtk_tree_path_new_from_node (model, id);
|
path = tree_path_new_from_node (model, id);
|
||||||
ITER_INIT_FROM_INDEX (model, &iter, id);
|
ITER_INIT_FROM_INDEX (model, &iter, id);
|
||||||
gtk_tree_model_row_inserted (GTK_TREE_MODEL (model), path, &iter);
|
gtk_tree_model_row_inserted (GTK_TREE_MODEL (model), path, &iter);
|
||||||
gtk_tree_path_free (path);
|
gtk_tree_path_free (path);
|
||||||
@ -290,7 +290,7 @@ emit_row_changed_for_node (GtkFileSystemModel *model, guint id)
|
|||||||
GtkTreePath *path;
|
GtkTreePath *path;
|
||||||
GtkTreeIter iter;
|
GtkTreeIter iter;
|
||||||
|
|
||||||
path = gtk_tree_path_new_from_node (model, id);
|
path = tree_path_new_from_node (model, id);
|
||||||
ITER_INIT_FROM_INDEX (model, &iter, id);
|
ITER_INIT_FROM_INDEX (model, &iter, id);
|
||||||
gtk_tree_model_row_changed (GTK_TREE_MODEL (model), path, &iter);
|
gtk_tree_model_row_changed (GTK_TREE_MODEL (model), path, &iter);
|
||||||
gtk_tree_path_free (path);
|
gtk_tree_path_free (path);
|
||||||
@ -570,7 +570,7 @@ gtk_file_system_model_get_path (GtkTreeModel *tree_model,
|
|||||||
|
|
||||||
g_return_val_if_fail (ITER_IS_VALID (model, iter), NULL);
|
g_return_val_if_fail (ITER_IS_VALID (model, iter), NULL);
|
||||||
|
|
||||||
return gtk_tree_path_new_from_node (model, ITER_INDEX (iter));
|
return tree_path_new_from_node (model, ITER_INDEX (iter));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user