FolderFiles
Object Hierarchy:
Description:
public class FolderFiles : Object, ListModel
Manages files and subfolders in a folder (hierarchical tree structure).
Provides both list (for tree view) and hashmap (for quick lookup) access. Implements ListModel interface using Gee.ArrayList as backing
store. Uses path-based comparison for equality. Emits items_changed signal when items are added/removed. Used for hierarchical tree views.
Content:
Properties:
- public HashMap<string,FileBase> child_map { get; }
Hashmap of [name in dir] => file object for quick lookup by
basename.
- public ArrayList<FileBase> items { get; set; }
Backing store: ArrayList containing files and folders (hierarchical,
with children). Uses path-based comparison for equality checks.
Creation methods:
Methods:
- public void append (FileBase item)
Append an item to the list (ListStore-compatible). Checks for
duplicates before adding.
- public async void cleanup_deleted ()
Cleanup deleted files from FolderFiles list and child_map.
- public bool contains (FileBase item)
Check if an item exists in the list.
- public bool find (FileBase item, out uint position)
Find an item in the list and return its position.
- public Object? get_item (uint position)
ListModel interface implementation: Get item at position.
- public Type get_item_type ()
ListModel interface implementation: Get the item type.
- public uint get_n_items ()
ListModel interface implementation: Get the number of items.
- public void insert (uint position, FileBase item)
Insert an item at a specific position.
- public void remove (FileBase item)
Remove an item from the list by item reference.
- public void remove_all ()
Remove all items from the list (ListStore-compatible, alias for
clear).
- public void remove_at (uint position)
Remove an item at a specific position (ListStore-compatible).
Inherited Members:
All known members inherited from class GLib.Object
- @get
- @new
- @ref
- @set
- add_toggle_ref
- add_weak_pointer
- bind_property
- connect
- constructed
- disconnect
- dispose
- dup_data
- dup_qdata
- force_floating
- freeze_notify
- get_class
- get_data
- get_property
- get_qdata
- get_type
- getv
- interface_find_property
- interface_install_property
- interface_list_properties
- is_floating
- new_valist
- new_with_properties
- newv
- notify
- notify_property
- ref_count
- ref_sink
- remove_toggle_ref
- remove_weak_pointer
- replace_data
- replace_qdata
- set_data
- set_data_full
- set_property
- set_qdata
- set_qdata_full
- set_valist
- setv
- steal_data
- steal_qdata
- thaw_notify
- unref
- watch_closure
- weak_ref
- weak_unref
All known members inherited from interface GLib.ListModel