Gtk.RecentInfo

Fields

None

Methods

  create_app_info (app_name)
  exists ()
  get_added ()
  get_age ()
  get_application_info (app_name)
  get_applications ()
  get_description ()
  get_display_name ()
  get_gicon ()
  get_groups ()
  get_icon (size)
  get_mime_type ()
  get_modified ()
  get_private_hint ()
  get_short_name ()
  get_uri ()
  get_uri_display ()
  get_visited ()
  has_application (app_name)
  has_group (group_name)
  is_local ()
  last_application ()
  match (info_b)
  ref ()
  unref ()

Details

class Gtk.RecentInfo

Gtk.RecentInfo-struct contains private data only, and should be accessed using the provided API.

Gtk.RecentInfo constains all the meta-data associated with an entry in the recently used files list.

New in version 2.10.

create_app_info(app_name)[source]
Parameters:app_name (str or None) – the name of the application that should be mapped to a Gio.AppInfo; if None is used then the default application for the MIME type is used
Raises:GLib.Error
Returns:the newly created Gio.AppInfo, or None. In case of error, error will be set either with a %GTK_RECENT_MANAGER_ERROR or a %G_IO_ERROR
Return type:Gio.AppInfo or None

Creates a Gio.AppInfo for the specified Gtk.RecentInfo

exists()[source]
Returns:True if the resource exists
Return type:bool

Checks whether the resource pointed by self still exists. At the moment this check is done only on resources pointing to local files.

New in version 2.10.

get_added()[source]
Returns:the number of seconds elapsed from system’s Epoch when the resource was added to the list, or -1 on failure.
Return type:int

Gets the timestamp (seconds from system’s Epoch) when the resource was added to the recently used resources list.

New in version 2.10.

get_age()[source]
Returns:a positive integer containing the number of days elapsed since the time this resource was last modified
Return type:int

Gets the number of days elapsed since the last update of the resource pointed by self.

New in version 2.10.

get_application_info(app_name)[source]
Parameters:app_name (str) – the name of the application that has registered this item
Returns:None if no application with app_name has registered this resource inside the recently used list otherwise a tuple containing:
app_exec:string containing the command line
count:the number of times this item was registered
time_:the timestamp this item was last registered for this application
Return type:(app_exec: str, count: int, time_: int) or None

Gets the data regarding the application that has registered the resource pointed by self.

If the command line contains any escape characters defined inside the storage specification, they will be expanded.

New in version 2.10.

get_applications()[source]
Returns:a newly allocated None-terminated array of strings. Use GLib.strfreev() to free it.
Return type:[str]

Retrieves the list of applications that have registered this resource.

New in version 2.10.

get_description()[source]
Returns:the description of the resource. The returned string is owned by the recent manager, and should not be freed.
Return type:str

Gets the (short) description of the resource.

New in version 2.10.

get_display_name()[source]
Returns:the display name of the resource. The returned string is owned by the recent manager, and should not be freed.
Return type:str

Gets the name of the resource. If none has been defined, the basename of the resource is obtained.

New in version 2.10.

get_gicon()[source]
Returns:a Gio.Icon containing the icon, or None. Use GObject.Object.unref() when finished using the icon
Return type:Gio.Icon or None

Retrieves the icon associated to the resource MIME type.

New in version 2.22.

get_groups()[source]
Returns:a newly allocated None terminated array of strings. Use GLib.strfreev() to free it.
Return type:[str]

Returns all groups registered for the recently used item self. The array of returned group names will be None terminated, so length might optionally be None.

New in version 2.10.

get_icon(size)[source]
Parameters:size (int) – the size of the icon in pixels
Returns:a GdkPixbuf.Pixbuf containing the icon, or None. Use GObject.Object.unref() when finished using the icon.
Return type:GdkPixbuf.Pixbuf or None

Retrieves the icon of size size associated to the resource MIME type.

New in version 2.10.

get_mime_type()[source]
Returns:the MIME type of the resource. The returned string is owned by the recent manager, and should not be freed.
Return type:str

Gets the MIME type of the resource.

New in version 2.10.

get_modified()[source]
Returns:the number of seconds elapsed from system’s Epoch when the resource was last modified, or -1 on failure.
Return type:int

Gets the timestamp (seconds from system’s Epoch) when the meta-data for the resource was last modified.

New in version 2.10.

get_private_hint()[source]
Returns:True if the private flag was found, False otherwise
Return type:bool

Gets the value of the “private” flag. Resources in the recently used list that have this flag set to True should only be displayed by the applications that have registered them.

New in version 2.10.

get_short_name()[source]
Returns:A newly-allocated string in UTF-8 encoding free it with GLib.free()
Return type: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”.

New in version 2.10.

get_uri()[source]
Returns:the URI of the resource. The returned string is owned by the recent manager, and should not be freed.
Return type:str

Gets the URI of the resource.

New in version 2.10.

get_uri_display()[source]
Returns:a newly allocated UTF-8 string containing the resource’s URI or None. Use GLib.free() when done using it.
Return type:str or 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 Gtk.RecentInfo.get_uri().

New in version 2.10.

get_visited()[source]
Returns:the number of seconds elapsed from system’s Epoch when the resource was last visited, or -1 on failure.
Return type:int

Gets the timestamp (seconds from system’s Epoch) when the meta-data for the resource was last visited.

New in version 2.10.

has_application(app_name)[source]
Parameters:app_name (str) – a string containing an application name
Returns:True if an application with name app_name was found, False otherwise
Return type:bool

Checks whether an application registered this resource using app_name.

New in version 2.10.

has_group(group_name)[source]
Parameters:group_name (str) – name of a group
Returns:True if the group was found
Return type:bool

Checks whether group_name appears inside the groups registered for the recently used item self.

New in version 2.10.

is_local()[source]
Returns:True if the resource is local
Return type:bool

Checks whether the resource is local or not by looking at the scheme of its URI.

New in version 2.10.

last_application()[source]
Returns:an application name. Use GLib.free() to free it.
Return type:str

Gets the name of the last application that have registered the recently used resource represented by self.

New in version 2.10.

match(info_b)[source]
Parameters:info_b (Gtk.RecentInfo) – a Gtk.RecentInfo
Returns:True if both Gtk.RecentInfo-struct point to the same resource, False otherwise
Return type:bool

Checks whether two Gtk.RecentInfo-struct point to the same resource.

New in version 2.10.

ref()[source]
Returns:the recent info object with its reference count increased by one
Return type:Gtk.RecentInfo

Increases the reference count of recent_info by one.

New in version 2.10.

unref()[source]

Decreases the reference count of self by one. If the reference count reaches zero, self is deallocated, and the memory freed.

New in version 2.10.