:right-sidebar: True RecentInfo =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: RecentInfo(*args, **kwargs) :no-contents-entry: ``GtkRecentInfo`` contains the metadata associated with an item in the recently used files list. Methods ------- .. rst-class:: interim-class .. class:: RecentInfo :no-index: .. method:: create_app_info(app_name: str | None = None) -> ~gi.repository.Gio.AppInfo | None Creates a ``GAppInfo`` for the specified ``GtkRecentInfo`` In case of error, ``error`` will be set either with a %GTK_RECENT_MANAGER_ERROR or a %G_IO_ERROR :param app_name: the name of the application that should be mapped to a ``GAppInfo``\; if :const:`None` is used then the default application for the MIME type is used .. method:: exists() -> bool Checks whether the resource pointed by ``info`` still exists. At the moment this check is done only on resources pointing to local files. .. method:: get_added() -> ~gi.repository.GLib.DateTime Gets the time when the resource was added to the recently used resources list. .. method:: get_age() -> int Gets the number of days elapsed since the last update of the resource pointed by ``info``\. .. method:: get_application_info(app_name: str) -> ~typing.Tuple[bool, str, int, ~gi.repository.GLib.DateTime] Gets the data regarding the application that has registered the resource pointed by ``info``\. If the command line contains any escape characters defined inside the storage specification, they will be expanded. :param app_name: the name of the application that has registered this item .. method:: get_applications() -> list[str] Retrieves the list of applications that have registered this resource. .. method:: get_description() -> str Gets the (short) description of the resource. .. method:: get_display_name() -> str Gets the name of the resource. If none has been defined, the basename of the resource is obtained. .. method:: get_gicon() -> ~gi.repository.Gio.Icon | None Retrieves the icon associated to the resource MIME type. .. method:: get_groups() -> list[str] Returns all groups registered for the recently used item ``info``\. The array of returned group names will be :const:`None` terminated, so length might optionally be :const:`None`. .. method:: get_mime_type() -> str Gets the MIME type of the resource. .. method:: get_modified() -> ~gi.repository.GLib.DateTime Gets the time when the meta-data for the resource was last modified. .. method:: get_private_hint() -> bool Gets the value of the “private” flag. Resources in the recently used list that have this flag set to :const:`True` should only be displayed by the applications that have registered them. .. method:: get_short_name() -> str Computes a valid UTF-8 string that can be used as the name of the item in a menu or list. For example, calling this function on an item that refers to “file:///foo/bar.txt” will yield “bar.txt”. .. method:: get_uri() -> str Gets the URI of the resource. .. method:: get_uri_display() -> str | None Gets a displayable version of the resource’s URI. If the resource is local, it returns a local path; if the resource is not local, it returns the UTF-8 encoded content of :obj:`~gi.repository.Gtk.RecentInfo.get_uri`\. .. method:: get_visited() -> ~gi.repository.GLib.DateTime Gets the time when the meta-data for the resource was last visited. .. method:: has_application(app_name: str) -> bool Checks whether an application registered this resource using ``app_name``\. :param app_name: a string containing an application name .. method:: has_group(group_name: str) -> bool Checks whether ``group_name`` appears inside the groups registered for the recently used item ``info``\. :param group_name: name of a group .. method:: is_local() -> bool Checks whether the resource is local or not by looking at the scheme of its URI. .. method:: last_application() -> str Gets the name of the last application that have registered the recently used resource represented by ``info``\. .. method:: match(info_b: ~gi.repository.Gtk.RecentInfo) -> bool Checks whether two ``GtkRecentInfo`` point to the same resource. :param info_b: a ``GtkRecentInfo``