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.
DirectoryList self()Returns `this`, for use in `with` statements.DirectoryListGidBuilder builder()Get builder for [gtk.directory_list.DirectoryList] Returns: New builder objectvoid 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.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 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 attributesglib.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 enumeratedint 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 monitoredbool 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.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
T attributes(string propval)Set `attributes` property. Params: propval = The attributes to query. Returns: Builder instance for fluent chainingT file(gio.file.File propval)Set `file` property. Params: propval = File to query. Returns: Builder instance for fluent chainingT ioPriority(int propval)Set `ioPriority` property. Params: propval = Priority used when loading. Returns: Builder instance for fluent chainingT monitored(bool propval)Set `monitored` property. Params: propval = true if the directory is monitored for changed. Returns: Builder instance for fluent chainingFluent builder for gtk.directory_list.DirectoryList
DirectoryList build()Create object from builder. Returns: New object