+ {
+ GtkRecentData recent_data;
+ gchar *full_mime_type;
+
+ if (encoding && encoding[0])
+ full_mime_type = g_strdup_printf ("%s; charset=%s",
+ mime_type, encoding);
+ else
+ full_mime_type = g_strdup (mime_type);
+
+ recent_data.display_name = NULL;
+ recent_data.description = NULL;
+ recent_data.mime_type = full_mime_type;
+ recent_data.app_name = CONST_CAST (gchar *, g_get_application_name ());
+ recent_data.app_exec = g_strjoin (" ", g_get_prgname (), "%u", NULL);
+ recent_data.groups = NULL;
+ recent_data.is_private = FALSE;
+
+ gtk_recent_manager_add_full (gtk_recent_manager_get_default (),
+ uri, &recent_data);
+
+ g_free (recent_data.app_exec);
+ g_free (full_mime_type);
+ }