DirectoryList
Object Hierarchy:
Description:
[
CCode ( type_id =
"gtk_directory_list_get_type ()" ) ]
public sealed class DirectoryList :
Object,
ListModel
A list model that wraps [method@Gio.
File.enumerate_children_async].
It presents a `GListModel` and fills it asynchronously with the `GFileInfo`s returned from that function.
Enumeration will start automatically when the [property@Gtk.DirectoryList:file] property is set.
While the `GtkDirectoryList` is being filled, the [property@Gtk.DirectoryList:loading] property will be set to
true. You can listen to that property if you want to show information like a `GtkSpinner` or a
"Loading..." text.
If loading fails at any point, the [property@Gtk.DirectoryList:error] property will be set to give more indication about the failure.
The `GFileInfo`s returned from a `GtkDirectoryList` have the "standard:file"
attribute set to the `GFile` they refer to. This way you can get at the file that is referred to in the same way you would via
get_child. This means you do not need access to the
`GtkDirectoryList`, but can access the `GFile` directly from the `GFileInfo` when operating with a `GtkListView` or similar.
Content:
Properties:
- public string attributes { get; set; }
The attributes to query.
- public Error error { get; }
Error encountered while loading files.
- public File file { get; set; }
File to query.
- public int io_priority { get; set; }
Priority used when loading.
- public Type item_type { get; }
The type of items.
- public bool loading { get; }
true if files are being loaded.
- public bool monitored { get; set; }
true if the directory is monitored
for changed.
- public uint n_items { get; }
The number of items.
Creation methods:
Methods:
- public unowned string? get_attributes ()
Gets the attributes queried on the children.
- public unowned Error? get_error ()
Gets the loading error, if any.
- public unowned File? get_file ()
Gets the file whose children are currently enumerated.
- public int get_io_priority ()
- public bool get_monitored ()
Returns whether the directory list is monitoring the directory for
changes.
- public bool is_loading ()
Returns true if the children
enumeration is currently in progress.
- public void set_attributes (string? attributes)
Sets the attributes to be enumerated and starts the
enumeration.
- public void set_file (File? file)
Sets the file to be enumerated and starts the
enumeration.
- public void set_io_priority (int io_priority)
Sets the IO priority to use while loading directories.
- public void set_monitored (bool monitored)
Sets whether the directory list will monitor the directory for
changes.
Inherited Members:
All known members inherited from class GLib.Object
All known members inherited from interface GLib.ListModel