[gtk/gbsneto/filechooser-column-view: 59/82] filesystemmodel: Add more GtkFileSystemItem getters
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gbsneto/filechooser-column-view: 59/82] filesystemmodel: Add more GtkFileSystemItem getters
- Date: Tue, 11 Oct 2022 22:04:06 +0000 (UTC)
commit ebfc99709bb25656cba8b1339d1abf7dd9f348a5
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Sat Oct 8 19:42:12 2022 -0300
filesystemmodel: Add more GtkFileSystemItem getters
They'll help us further remove GtkTreeModel code.
gtk/gtkfilesystemmodel.c | 22 ++++++++++++++++++++++
gtk/gtkfilesystemmodel.h | 5 +++++
2 files changed, 27 insertions(+)
---
diff --git a/gtk/gtkfilesystemmodel.c b/gtk/gtkfilesystemmodel.c
index 5104a58033..79ef17770d 100644
--- a/gtk/gtkfilesystemmodel.c
+++ b/gtk/gtkfilesystemmodel.c
@@ -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;
+}
diff --git a/gtk/gtkfilesystemmodel.h b/gtk/gtkfilesystemmodel.h
index a69992c24a..d73e9e811d 100644
--- a/gtk/gtkfilesystemmodel.h
+++ b/gtk/gtkfilesystemmodel.h
@@ -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__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]