filesystemmodel: Add more GtkFileSystemItem getters

They'll help us further remove GtkTreeModel code.
This commit is contained in:
Georges Basile Stavracas Neto 2022-10-08 19:42:12 -03:00 committed by Matthias Clasen
parent d5b31a30fd
commit 1f2561b08e
2 changed files with 27 additions and 0 deletions

View File

@ -1912,3 +1912,25 @@ _gtk_file_system_item_get_file_info (GtkFileSystemItem *item)
{
return item->node->info;
}
gboolean
_gtk_file_system_item_is_visible (GtkFileSystemItem *item)
{
return item->node->visible;
}
GtkFileSystemItem *
_gtk_file_system_model_get_item_for_file(GtkFileSystemModel *model,
GFile *file)
{
FileModelNode *node;
guint i;
i = node_get_for_file (model, file);
if (i == 0)
return NULL;
node = get_node (model, i);
return node->item;
}

View File

@ -104,6 +104,11 @@ GFile * _gtk_file_system_item_get_file (GtkFileSystemItem
GFileInfo * _gtk_file_system_item_get_file_info (GtkFileSystemItem *item);
gboolean _gtk_file_system_item_is_visible (GtkFileSystemItem *item);
GtkFileSystemItem * _gtk_file_system_model_get_item_for_file(GtkFileSystemModel *model,
GFile *file);
G_END_DECLS
#endif /* __GTK_FILE_SYSTEM_MODEL_H__ */