[gtk/gbsneto/filechooser-column-view: 71/105] filesystemmodel: Add more GtkFileSystemItem getters




commit 28aca6d6d6f1cf2b9d4772533680c9ca4452ea9e
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]