DirectoryList
Superclasses: Object
Implemented Interfaces: ListModel
- Constructors:
DirectoryList(**properties)
new(attributes:str=None, file:Gio.File=None) -> Gtk.DirectoryList
Constructors
Methods
- class DirectoryList
-
- get_error() GError | None
Gets the loading error, if any.
If an error occurs during the loading process, the loading process will finish and this property allows querying the error that happened. This error will persist until a file is loaded again.
An error being set does not mean that no files were loaded, and all successfully queried files will remain in the list.
- get_io_priority() int
Gets the IO priority set via
set_io_priority()
.
- is_loading() bool
Returns
True
if the children enumeration is currently in progress.Files will be added to
self
from time to time while loading is going on. The order in which are added is undefined and may change in between runs.
- set_attributes(attributes: str | None = None) None
Sets the
attributes
to be enumerated and starts the enumeration.If
attributes
isNone
, the list of file infos will still be created, it will just not contain any extra attributes.- Parameters:
attributes – the attributes to enumerate
- set_file(file: File | None = None) None
Sets the
file
to be enumerated and starts the enumeration.If
file
isNone
, the result will be an empty list.- Parameters:
file – the
GFile
to be enumerated
- set_io_priority(io_priority: int) None
Sets the IO priority to use while loading directories.
Setting the priority while
self
is loading will reprioritize the ongoing load as soon as possible.The default IO priority is
%G_PRIORITY_DEFAULT
, which is higher than the GTK redraw priority. If you are loading a lot of directories in parallel, lowering it to something like%G_PRIORITY_DEFAULT_IDLE
may increase responsiveness.- Parameters:
io_priority – IO priority to use
- set_monitored(monitored: bool) None
Sets whether the directory list will monitor the directory for changes.
If monitoring is enabled, the ::items-changed signal will be emitted when the directory contents change.
When monitoring is turned on after the initial creation of the directory list, the directory is reloaded to avoid missing files that appeared between the initial loading and when monitoring was turned on.
- Parameters:
monitored –
True
to monitor the directory for changes
Properties
- class DirectoryList
-
- props.error: GError
Error encountered while loading files.
- props.item_type: type
The type of items. See
get_item_type
.Added in version 4.8.
- props.n_items: int
The number of items. See
get_n_items
.Added in version 4.8.