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.FileInfos 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.FileInfos 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 _getGType() static nothrow
GType _gType() @property nothrow
DirectoryList self() nothrowReturns `this`, for use in `with` statements.
DirectoryListGidBuilder builder() static nothrowGet builder for [gtk.directory_list.DirectoryList] Returns: New builder object
string attributes() @property nothrowGet `attributes` property. Returns: The attributes to query.
void attributes(string propval) @property nothrowSet `attributes` property. Params: propval = The attributes to query.
glib.error.ErrorWrap error() @property nothrowGet `error` property. Returns: Error encountered while loading files.
gio.file.File file() @property nothrowGet `file` property. Returns: File to query.
void file(gio.file.File propval) @property nothrowSet `file` property. Params: propval = File to query.
int ioPriority() @property nothrowGet `ioPriority` property. Returns: Priority used when loading.
void ioPriority(int propval) @property nothrowSet `ioPriority` property. Params: propval = Priority used when loading.
gobject.types.GType itemType() @property nothrowGet `itemType` property. Returns: The type of items. See [gio.list_model.ListModel.getItemType].
bool loading() @property nothrowGet `loading` property. Returns: true if files are being loaded.
bool monitored() @property nothrowGet `monitored` property. Returns: true if the directory is monitored for changed.
void monitored(bool propval) @property nothrowSet `monitored` property. Params: propval = true if the directory is monitored for changed.
uint nItems() @property nothrowGet `nItems` property. Returns: The number of items. See [gio.list_model.ListModel.getNItems].
string getAttributes() nothrowGets the attributes queried on the children. Returns: The queried attributes
glib.error.ErrorWrap getError() nothrowGets the loading error, if any.
gio.file.File getFile() nothrowGets the file whose children are currently enumerated. Returns: The file whose children are enumerated
int getIoPriority() nothrowGets the IO priority set via [gtk.directory_list.DirectoryList.setIoPriority]. Returns: The IO priority.
bool getMonitored() nothrowReturns whether the directory list is monitoring the directory for changes. Returns: true if the directory is monitored
bool isLoading() nothrowReturns true if the children enumeration is currently in progress.
void setAttributes(string attributes = null) nothrowSets the attributes to be enumerated and starts the enumeration.
void setFile(gio.file.File file = null) nothrowSets the file to be enumerated and starts the enumeration.
void setIoPriority(int ioPriority) nothrowSets the IO priority to use while loading directories.
void setMonitored(bool monitored) nothrowSets 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].

Fluent builder implementation template for gtk.directory_list.DirectoryList

Methods
T attributes(string propval) nothrowSet `attributes` property. Params: propval = The attributes to query. Returns: Builder instance for fluent chaining
T file(gio.file.File propval) nothrowSet `file` property. Params: propval = File to query. Returns: Builder instance for fluent chaining
T ioPriority(int propval) nothrowSet `ioPriority` property. Params: propval = Priority used when loading. Returns: Builder instance for fluent chaining
T monitored(bool propval) nothrowSet `monitored` property. Params: propval = true if the directory is monitored for changed. Returns: Builder instance for fluent chaining
Methods
DirectoryList build() nothrowCreate object from builder. Returns: New object