[epiphany] Avoid blank items in back/forward menus
- From: Diego Escalante Urrelo <diegoe src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [epiphany] Avoid blank items in back/forward menus
- Date: Mon, 11 Jan 2010 20:11:17 +0000 (UTC)
commit 9ea9e684b4cb5563d5b395a93b923771b0f6bffc
Author: Diego Escalante Urrelo <diegoe gnome org>
Date: Mon Jan 11 14:00:35 2010 -0500
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]