From 5b640c7f46ce454c71011e3f123478933cb42c98 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sat, 31 Jul 2010 01:21:50 +0200 Subject: [PATCH] Store address of bookmarks for tooltip as a string in the model --- katze/katze-utils.c | 4 +++- panels/midori-bookmarks.c | 3 ++- panels/midori-history.c | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/katze/katze-utils.c b/katze/katze-utils.c index 39c70583..dc7f7946 100644 --- a/katze/katze-utils.c +++ b/katze/katze-utils.c @@ -1138,8 +1138,10 @@ katze_bookmark_populate_tree_view (KatzeArray* array, { if (KATZE_ITEM_IS_BOOKMARK (child)) { + gchar* tooltip = g_markup_escape_text (katze_item_get_uri (child), -1); gtk_tree_store_insert_with_values (model, NULL, parent, - 0, 0, child, -1); + 0, 0, child, 1, tooltip, -1); + g_free (tooltip); } else { diff --git a/panels/midori-bookmarks.c b/panels/midori-bookmarks.c index 1f94c897..b572a98c 100644 --- a/panels/midori-bookmarks.c +++ b/panels/midori-bookmarks.c @@ -941,9 +941,10 @@ midori_bookmarks_init (MidoriBookmarks* bookmarks) gtk_box_pack_start (GTK_BOX (bookmarks), box, FALSE, FALSE, 5); /* Create the treeview */ - model = gtk_tree_store_new (1, KATZE_TYPE_ITEM); + model = gtk_tree_store_new (2, KATZE_TYPE_ITEM, G_TYPE_STRING); treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model)); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview), FALSE); + gtk_tree_view_set_tooltip_column (GTK_TREE_VIEW (treeview), 1); column = gtk_tree_view_column_new (); renderer_pixbuf = gtk_cell_renderer_pixbuf_new (); gtk_tree_view_column_pack_start (column, renderer_pixbuf, FALSE); diff --git a/panels/midori-history.c b/panels/midori-history.c index 1af95429..d8aed73f 100644 --- a/panels/midori-history.c +++ b/panels/midori-history.c @@ -892,9 +892,10 @@ midori_history_init (MidoriHistory* history) gtk_box_pack_start (GTK_BOX (history), box, FALSE, FALSE, 5); /* Create the treeview */ - model = gtk_tree_store_new (1, KATZE_TYPE_ITEM); + model = gtk_tree_store_new (2, KATZE_TYPE_ITEM, G_TYPE_STRING); treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model)); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview), FALSE); + gtk_tree_view_set_tooltip_column (GTK_TREE_VIEW (treeview), 1); column = gtk_tree_view_column_new (); renderer_pixbuf = gtk_cell_renderer_pixbuf_new (); gtk_tree_view_column_pack_start (column, renderer_pixbuf, FALSE); -- 2.39.5