Skip to content

Gtk.BookmarkList

class — extends GObject.Object, Gio.ListModel

A list model that wraps GBookmarkFile.

It presents a GListModel and fills it asynchronously with the GFileInfos returned from that function.

The GFileInfos in the list have some attributes in the recent namespace added: recent::private (boolean) and recent:applications (stringv).

Constructors

new

@classmethod
def new(cls, filename: str | bytes | os.PathLike[str] | os.PathLike[bytes] | None = ..., attributes: str | None = ...) -> BookmarkList

Creates a new GtkBookmarkList with the given attributes.

Parameters:

  • filename — The bookmark file to load
  • attributes — The attributes to query

Methods

get_attributes

def get_attributes(self) -> str | None

Gets the attributes queried on the children.

get_filename

def get_filename(self) -> str

Returns the filename of the bookmark file that this list is loading.

get_io_priority

def get_io_priority(self) -> int

Gets the IO priority to use while loading file.

is_loading

def is_loading(self) -> bool

Returns True if the files are currently being loaded.

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

def set_attributes(self, attributes: str | None = ...) -> None

Sets the attributes to be enumerated and starts the enumeration.

If attributes is None, no attributes will be queried, but a list of GFileInfos will still be created.

Parameters:

  • attributes — the attributes to enumerate

set_io_priority

def set_io_priority(self, io_priority: int) -> None

Sets the IO priority to use while loading files.

The default IO priority is GLib.PRIORITY_DEFAULT.

Parameters:

  • io_priority — IO priority to use

Properties

attributes

attributes: str  # read/write

The attributes to query.

filename

filename: str  # read/write

The bookmark file to load.

io_priority

io_priority: int  # read/write

Priority used when loading.

item_type

item_type: type | GObject.Type  # read-only

The type of items. See Gio.ListModel.get_item_type.

loading

loading: bool  # read-only

True if files are being loaded.

n_items

n_items: int  # read-only

The number of items. See Gio.ListModel.get_n_items.