aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiego Escalante Urrelo <diegoe@gnome.org>2010-01-12 03:00:35 +0800
committerDiego Escalante Urrelo <diegoe@gnome.org>2010-01-12 04:00:17 +0800
commit9ea9e684b4cb5563d5b395a93b923771b0f6bffc (patch)
tree75134c1a49189eafd968de96b1d70cff09961373
parent4440ca97ae001b4f63f4a2efc8a765448c5cfa67 (diff)
downloadgsoc2013-epiphany-9ea9e684b4cb5563d5b395a93b923771b0f6bffc.tar
gsoc2013-epiphany-9ea9e684b4cb5563d5b395a93b923771b0f6bffc.tar.gz
gsoc2013-epiphany-9ea9e684b4cb5563d5b395a93b923771b0f6bffc.tar.bz2
gsoc2013-epiphany-9ea9e684b4cb5563d5b395a93b923771b0f6bffc.tar.lz
gsoc2013-epiphany-9ea9e684b4cb5563d5b395a93b923771b0f6bffc.tar.xz
gsoc2013-epiphany-9ea9e684b4cb5563d5b395a93b923771b0f6bffc.tar.zst
gsoc2013-epiphany-9ea9e684b4cb5563d5b395a93b923771b0f6bffc.zip
Avoid blank items in back/forward menus
Use the url of the page as its menu label if there's no title set. Bug #604491
-rw-r--r--src/ephy-navigation-action.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/ephy-navigation-action.c b/src/ephy-navigation-action.c
index d19cf21fb..d3c31299b 100644
--- a/src/ephy-navigation-action.c
+++ b/src/ephy-navigation-action.c
@@ -236,13 +236,20 @@ build_back_or_forward_menu (EphyNavigationAction *action)
{
GtkWidget *item;
WebKitWebHistoryItem *hitem;
- const char *title, *url;
+ const char *url;
+ char *title;
hitem = (WebKitWebHistoryItem*)l->data;
url = webkit_web_history_item_get_uri (hitem);
- title = webkit_web_history_item_get_title (hitem);
- item = new_history_menu_item (title ? title : url, url);
+ title = g_strdup (webkit_web_history_item_get_title (hitem));
+
+ if ((title == NULL || g_strstrip (title)[0] == '\0'))
+ item = new_history_menu_item (url, url);
+ else
+ item = new_history_menu_item (title, url);
+
+ g_free (title);
g_object_set_data_full (G_OBJECT (item), HISTORY_ITEM_DATA_KEY,
g_object_ref (hitem), g_object_unref);