Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: DirectoryListMeta

[318:14] static extends: object

Generated metadata helpers for DirectoryList class surfaces.

Methods

  • properties ()

    Returns property metadata for DirectoryList.

    • @r A list.

class: DirectoryList

[25:7] extends: object

A list model that wraps [method@Gio.File.enumerate_children_async]. It presents a GListModel and fills it asynchronously with the GFileInfos 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 GFileInfos 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 g_file_enumerator_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.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • DirectoryList (attributes = null, file = null)

    Creates a new GtkDirectoryList. The GtkDirectoryList is querying the given @file with the given @attributes.

    • @p attributes is The attributes to query with.
    • @p file is The file to query.
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • asObject ()

    Wraps this handle as Object.

    • @r A Object object.
  • asListModel ()

    Wraps this handle as ListModel.

    • @r A ListModel object.
  • getProperty (string Name)

    Reads one generated property by name.

  • setProperty (string Name, Value)

    Writes one generated property by name.

  • setAttributes (string Value)

    The attributes to query.

    • @p Value is the new property value.
    • @r None.
  • setFile (object Value)

    File to query.

    • @p Value is the new property value.
    • @r None.
  • setIopriority (int Value)

    Priority used when loading.

    • @p Value is the new property value.
    • @r None.
  • setMonitored (bool Value)

    %TRUE if the directory is monitored for changed.

    • @p Value is the new property value.
    • @r None.
  • get_attributes ()

    Gets the attributes queried on the children.

  • get_error ()

    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_file ()

    Gets the file whose children are currently enumerated.

  • get_io_priority ()

    Gets the IO priority set via gtk_directory_list_set_io_priority().

  • get_monitored ()

    Returns whether the directory list is monitoring the directory for changes.

  • is_loading ()

    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 (string attributes)

    Sets the @attributes to be enumerated and starts the enumeration. If

    • @attributes is %NULL, the list of file infos will still be created, it will just not contain any extra attributes.
    • @p attributes is the attributes to enumerate.
    • @r None.
  • set_file (object file)

    Sets the @file to be enumerated and starts the enumeration. If @file is %NULL, the result will be an empty list.

    • @p file is the GFile to be enumerated.
    • @r None.
  • set_io_priority (int io_priority)

    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.

    • @p io_priority is IO priority to use.
    • @r None.
  • set_monitored (bool monitored)

    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.

    • @p monitored is %TRUE to monitor the directory for changes.
    • @r None.