[ CCode ( type_id = "gtk_recent_manager_get_type ()" ) ] [ Version ( since = "2.10" ) ] publicclassRecentManager : Object
RecentManager provides a facility for adding, removing and looking up recently used files.
Each recently used file is identified by its URI, and has meta-data associated to it, like the names and command lines of the
applications that have registered it, the number of time each application has registered the same file, the mime type of the file and
whether the file should be displayed only by the applications that have registered it.
The recently used files list is per user.
The RecentManager acts like a database of all the recently used files. You can create new
RecentManager objects, but it is more efficient to use the default manager created by GTK+.
manager = gtk_recent_manager_get_default (); info = gtk_recent_manager_lookup_item (manager, file_uri, &error); if (error) { g_warning ("Could not find the file: %s", error->message); g_error_free (error); } else { // Use the info object gtk_recent_info_unref (info); }
In order to retrieve the list of recently used files, you can use get_items
, which returns a list of RecentInfo-structs.
A RecentManager is the model used to populate the contents of one, or more
RecentChooser implementations.
Note that the maximum age of the recently used files list is controllable through the
gtk_recent_files_max_age property.
Recently used files are supported since GTK+ 2.10.
Adds a new resource, pointed by uri, into the recently
used resources list, using the metadata specified inside the RecentData-struct passed
in recent_data.
Searches for a URI inside the recently used resources list, and
returns a RecentInfo-struct containing informations about the resource like its MIME
type, or its display name.