gtk.directory_list

Module for [DirectoryList] class

Types 3

[gtk.directory_list.DirectoryList] is a list model that wraps [gio.file.File.enumerateChildrenAsync].

It presents a [gio.list_model.ListModel] and fills it asynchronously with the [gio.file_info.FileInfo]s returned from that function.

Enumeration will start automatically when the [gtk.directory_list.DirectoryList.file] property is set.

While the [gtk.directory_list.DirectoryList] is being filled, the [gtk.directory_list.DirectoryList.loading] property will be set to true. You can listen to that property if you want to show information like a [gtk.spinner.Spinner] or a "Loading..." text.

If loading fails at any point, the [gtk.directory_list.DirectoryList.error] property will be set to give more indication about the failure.

The [gio.file_info.FileInfo]s returned from a [gtk.directory_list.DirectoryList] have the "standard::file" attribute set to the [gio.file.File] they refer to. This way you can get at the file that is referred to in the same way you would via [gio.file_enumerator.FileEnumerator.getChild]. This means you do not need access to the [gtk.directory_list.DirectoryList], but can access the [gio.file.File] directly from the [gio.file_info.FileInfo] when operating with a [gtk.list_view.ListView] or similar.

Methods
GType _gType() @property
DirectoryList self()Returns `this`, for use in `with` statements.
DirectoryListGidBuilder builder()Get builder for [gtk.directory_list.DirectoryList] Returns: New builder object
string attributes() @propertyGet `attributes` property. Returns: The attributes to query.
void attributes(string propval) @propertySet `attributes` property. Params: propval = The attributes to query.
glib.error.ErrorWrap error() @propertyGet `error` property. Returns: Error encountered while loading files.
gio.file.File file() @propertyGet `file` property. Returns: File to query.
void file(gio.file.File propval) @propertySet `file` property. Params: propval = File to query.
int ioPriority() @propertyGet `ioPriority` property. Returns: Priority used when loading.
void ioPriority(int propval) @propertySet `ioPriority` property. Params: propval = Priority used when loading.
gobject.types.GType itemType() @propertyGet `itemType` property. Returns: The type of items. See [gio.list_model.ListModel.getItemType].
bool loading() @propertyGet `loading` property. Returns: true if files are being loaded.
bool monitored() @propertyGet `monitored` property. Returns: true if the directory is monitored for changed.
void monitored(bool propval) @propertySet `monitored` property. Params: propval = true if the directory is monitored for changed.
uint nItems() @propertyGet `nItems` property. Returns: The number of items. See [gio.list_model.ListModel.getNItems].
string getAttributes()Gets the attributes queried on the children. Returns: The queried attributes
glib.error.ErrorWrap getError()Gets the loading error, if any.
gio.file.File getFile()Gets the file whose children are currently enumerated. Returns: The file whose children are enumerated
int getIoPriority()Gets the IO priority set via [gtk.directory_list.DirectoryList.setIoPriority]. Returns: The IO priority.
bool getMonitored()Returns whether the directory list is monitoring the directory for changes. Returns: true if the directory is monitored
bool isLoading()Returns true if the children enumeration is currently in progress.
void setAttributes(string attributes = null)Sets the attributes to be enumerated and starts the enumeration.
void setFile(gio.file.File file = null)Sets the file to be enumerated and starts the enumeration.
void setIoPriority(int ioPriority)Sets the IO priority to use while loading directories.
void setMonitored(bool monitored)Sets whether the directory list will monitor the directory for changes.
Constructors
this(void * ptr, Flag!"Take" take)
this(string attributes = null, gio.file.File file = null)Creates a new [gtk.directory_list.DirectoryList].
Methods
T attributes(string propval)Set `attributes` property. Params: propval = The attributes to query. Returns: Builder instance for fluent chaining
T file(gio.file.File propval)Set `file` property. Params: propval = File to query. Returns: Builder instance for fluent chaining
T ioPriority(int propval)Set `ioPriority` property. Params: propval = Priority used when loading. Returns: Builder instance for fluent chaining
T monitored(bool propval)Set `monitored` property. Params: propval = true if the directory is monitored for changed. Returns: Builder instance for fluent chaining

Fluent builder for [gtk.directory_list.DirectoryList]