From dcf754740e427c738db36f07f9f870fde51dfa85 Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Sun, 25 Nov 2007 13:47:48 +0000 Subject: Fix empty line on bookmark tooltip when bookmark has no title. Close bug #499226. svn path=/trunk/; revision=7730 --- src/bookmarks/ephy-bookmark-action.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/bookmarks/ephy-bookmark-action.c b/src/bookmarks/ephy-bookmark-action.c index 011277548..7e0531582 100644 --- a/src/bookmarks/ephy-bookmark-action.c +++ b/src/bookmarks/ephy-bookmark-action.c @@ -445,16 +445,32 @@ query_tooltip_cb (GtkWidget *proxy, GnomeVFSURI *uri = gnome_vfs_uri_new (location); if (uri != NULL) { - text = g_markup_printf_escaped ("%s\n%s://%s", - title, - gnome_vfs_uri_get_scheme (uri), - gnome_vfs_uri_get_host_name (uri)); + if (title[0] == '\0') + { + text = g_markup_printf_escaped ("%s://%s", + gnome_vfs_uri_get_scheme (uri), + gnome_vfs_uri_get_host_name (uri)); + } + else + { + text = g_markup_printf_escaped ("%s\n%s://%s", + title, + gnome_vfs_uri_get_scheme (uri), + gnome_vfs_uri_get_host_name (uri)); + } gnome_vfs_uri_unref (uri); } } if (text == NULL) { - text = g_markup_printf_escaped ("%s\n%s", title, location); + if (title[0] == '\0') + { + text = g_markup_printf_escaped ("%s", location); + } + else + { + text = g_markup_printf_escaped ("%s\n%s", title, location); + } } } gtk_tooltip_set_markup (tooltip, text); -- cgit v1.2.3