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
This commit is contained in:
Cosimo Cecchi 2015-05-23 16:14:39 -07:00
parent 48bfabe59e
commit e0b1ea11cc

View File

@ -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 *