Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 44339d44aebdbcb3150016e0ca8ce880fbb436da Mon Sep 17 00:00:00 2001
- From: Diego Escalante Urrelo <diegoe@gnome.org>
- Date: Mon, 11 Jan 2010 14:00:35 -0500
- Subject: [PATCH] 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
- ---
- src/ephy-navigation-action.c | 13 ++++++++++---
- 1 files changed, 10 insertions(+), 3 deletions(-)
- diff --git a/src/ephy-navigation-action.c b/src/ephy-navigation-action.c
- index d19cf21..d3c3129 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);
- --
- 1.6.6
Add Comment
Please, Sign In to add comment