GtkRecentManager

## GtkRecentManager GtkRecentManager — Managing Recently Used Files |

## Includes

    #include <gtk/gtk.h>

## Description

GtkRecentManager 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 GtkRecentManager acts like a database of all the recently used files. You can create new GtkRecentManager objects, but it is more efficient to use the standard recent manager for the GdkScreen so that informations about the recently used files is shared with other people using them. In case the default screen is being used, adding a new recently used file is as simple as:

    1
    2
    3
    GtkRecentManager *manager;
    manager = gtk_recent_manager_get_default ();
    gtk_recent_manager_add_item (manager, file_uri);

While looking up a recently used file is as simple as:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    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);
      }

Recently used files are supported since GTK+ 2.10.

## Functions

## Types and Values