Gtk.RecentInfo¶
Fields¶
None
Methods¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
orNone
) – the name of the application that should be mapped to aGio.AppInfo
; ifNone
is used then the default application for the MIME type is used- Raises:
- Returns:
the newly created
Gio.AppInfo
, orNone
. In case of error, error will be set either with a %GTK_RECENT_MANAGER_ERROR or a %G_IO_ERROR- Return type:
Gio.AppInfo
orNone
Creates a
Gio.AppInfo
for the specifiedGtk.RecentInfo
- exists()[source]¶
-
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:
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:
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:
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. UseGLib.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:
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:
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, orNone
. UseGObject.Object.unref
() when finished using the icon- Return type:
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. UseGLib.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 beNone
.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, orNone
. UseGObject.Object.unref
() when finished using the icon.- Return type:
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:
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:
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]¶
-
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]¶
-
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:
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
. UseGLib.free
() when done using it.- Return type:
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:
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:
Checks whether an application registered this resource using app_name.
New in version 2.10.
- has_group(group_name)[source]¶
-
Checks whether group_name appears inside the groups registered for the recently used item self.
New in version 2.10.
- is_local()[source]¶
-
Checks whether the resource is local or not by looking at the scheme of its URI.
New in version 2.10.
- last_application()[source]¶
-
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
) – aGtk.RecentInfo
- Returns:
True
if bothGtk.RecentInfo
-struct point to the same resource,False
otherwise- Return type:
Checks whether two
Gtk.RecentInfo
-struct point to the same resource.New in version 2.10.