[gtk+] placessidebar: escape tooltip text before setting it
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] placessidebar: escape tooltip text before setting it
- Date: Sun, 24 May 2015 19:04:44 +0000 (UTC)
commit e0b1ea11ccfc8e1b357531d4854295ba552e6fb4
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Sat May 23 16:14:39 2015 -0700
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 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c
index a5bc74b..41ec9ac 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 *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]