From e0b1ea11ccfc8e1b357531d4854295ba552e6fb4 Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Sat, 23 May 2015 16:14:39 -0700 Subject: [PATCH] placessidebar: escape tooltip text before setting it gtk_tree_view_set_tooltip_column() specifies that markup in the text should be escaped. This fixes critical warnings when hovering over items in the sidebar for bookmarks that have markup characters in their names. https://bugzilla.gnome.org/show_bug.cgi?id=719683 --- gtk/gtkplacessidebar.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c index a5bc74b1b7..41ec9acd4a 100644 --- a/gtk/gtkplacessidebar.c +++ b/gtk/gtkplacessidebar.c @@ -496,6 +496,7 @@ add_place (GtkPlacesSidebar *sidebar, GtkTreeIter iter; gboolean show_eject, show_unmount; gboolean show_eject_button; + gchar *tooltip_escaped; check_heading_for_section (sidebar, section_type); @@ -510,6 +511,8 @@ add_place (GtkPlacesSidebar *sidebar, else show_eject_button = (show_unmount || show_eject); + tooltip_escaped = g_markup_escape_text (tooltip, -1); + gtk_list_store_append (sidebar->store, &iter); gtk_list_store_set (sidebar->store, &iter, PLACES_SIDEBAR_COLUMN_GICON, icon, @@ -523,9 +526,11 @@ add_place (GtkPlacesSidebar *sidebar, PLACES_SIDEBAR_COLUMN_EJECT, show_eject_button, PLACES_SIDEBAR_COLUMN_NO_EJECT, !show_eject_button, PLACES_SIDEBAR_COLUMN_BOOKMARK, place_type != PLACES_BOOKMARK, - PLACES_SIDEBAR_COLUMN_TOOLTIP, tooltip, + PLACES_SIDEBAR_COLUMN_TOOLTIP, tooltip_escaped, PLACES_SIDEBAR_COLUMN_SECTION_TYPE, section_type, -1); + + g_free (tooltip_escaped); } static GIcon *