Escape markup entities in the name and URI before displaying them.

2007-06-29  Emmanuele Bassi  <ebassi@gnome.org>

	* gtk/gtkrecentchooserdefault.c (recent_meta_data_func): Escape
	markup entities in the name and URI before displaying them.

svn path=/trunk/; revision=18289
This commit is contained in:
Emmanuele Bassi 2007-06-29 15:02:14 +00:00 committed by Emmanuele Bassi
parent 612d8729a2
commit 41aaca420d
2 changed files with 15 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2007-06-29 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkrecentchooserdefault.c (recent_meta_data_func): Escape
markup entities in the name and URI before displaying them.
2007-06-29 Emmanuele Bassi <ebassi@gnome.org> 2007-06-29 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkrecentmanager.c (get_icon_for_mime_type): Do not * gtk/gtkrecentmanager.c (get_icon_for_mime_type): Do not

View File

@ -973,8 +973,8 @@ recent_meta_data_func (GtkTreeViewColumn *tree_column,
gpointer user_data) gpointer user_data)
{ {
GtkRecentInfo *info = NULL; GtkRecentInfo *info = NULL;
gchar *uri, *name; gchar *uri, *name, *str;
gchar *str; gchar *escaped_name, *escaped_location;
gtk_tree_model_get (model, iter, gtk_tree_model_get (model, iter,
RECENT_DISPLAY_NAME_COLUMN, &name, RECENT_DISPLAY_NAME_COLUMN, &name,
@ -987,12 +987,17 @@ recent_meta_data_func (GtkTreeViewColumn *tree_column,
if (!name) if (!name)
name = gtk_recent_info_get_short_name (info); name = gtk_recent_info_get_short_name (info);
str = g_strconcat ("<b>", name, "</b>\n", escaped_name = g_markup_printf_escaped ("<b>%s</b>", name);
"<small>", _("Location:"), " ", uri, "</small>", escaped_location = g_markup_printf_escaped ("<small>%s: %s</small>",
NULL); _("Location"),
uri);
str = g_strjoin ("\n", escaped_name, escaped_location, NULL);
g_free (escaped_name);
g_free (escaped_location);
g_object_set (cell, "markup", str, NULL); g_object_set (cell, "markup", str, NULL);
g_free (str);
g_free (uri); g_free (uri);
g_free (name); g_free (name);
gtk_recent_info_unref (info); gtk_recent_info_unref (info);