Package: gtk

Class gtk-recent-manager

Superclasses

g-object, common-lisp:standard-object, common-lisp:t

Documented Subclasses

None

Direct Slots

filename
The filename property of type :string (Read / Write / Construct)
The full path to the file to be used to store and read the recently used resources list.
Default value: nil
size
The size property of type :int (Read)
The size of the recently used resources list.
Allowed values: >= 0
Default value: 0

Details

The gtk-recent-manager object 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 gtk-recent-manager object acts like a database of all the recently used files. You can create new gtk-recent-manager objects, but it is more efficient to use the default manager created by GTK.

Adding a new recently used file is as simple as:
GtkRecentManager *manager;

manager = gtk_recent_manager_get_default (); gtk_recent_manager_add_item (manager, file_uri);
The gtk-recent-manager will try to gather all the needed information from the file itself through GIO.

Looking up the meta-data associated with a recently used file given its URI requires calling the function gtk-recent-manager-lookup-item:
GtkRecentManager *manager;
GtkRecentInfo *info;
GError *error = NULL;

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 the gtk-recent-manager-items function, which returns a list of gtk-recent-info instances.

A gtk-recent-manager object is the model used to populate the contents of one, or more gtk-recent-chooser implementations.

The maximum age of the recently used files list is controllable through the gtk-recent-files-max-age settting of the gtk-settings class.

Signal Details

The "changed" signal
 lambda (manager)    :run-first      
Emitted when the current recently used resources manager changes its contents, either by calling the gtk-recent-manager-add-item function or by another application.
manager
The gtk-recent-manager object which received the signal.
 

Slot Access Functions

Inherited Slot Access Functions

2021-12-27