aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-navigation-action.c
diff options
context:
space:
mode:
authorXan Lopez <xan@src.gnome.org>2007-12-30 07:39:23 +0800
committerXan Lopez <xan@src.gnome.org>2007-12-30 07:39:23 +0800
commit2a776b7f4ea30e814b2703a50633143b5b0ebc95 (patch)
tree5bbcfc00e1a574c903b56dc4c2bce782bfe28d4a /src/ephy-navigation-action.c
parent8fdb4086efaad93d0c9349520081a9608853fca0 (diff)
downloadgsoc2013-epiphany-2a776b7f4ea30e814b2703a50633143b5b0ebc95.tar
gsoc2013-epiphany-2a776b7f4ea30e814b2703a50633143b5b0ebc95.tar.gz
gsoc2013-epiphany-2a776b7f4ea30e814b2703a50633143b5b0ebc95.tar.bz2
gsoc2013-epiphany-2a776b7f4ea30e814b2703a50633143b5b0ebc95.tar.lz
gsoc2013-epiphany-2a776b7f4ea30e814b2703a50633143b5b0ebc95.tar.xz
gsoc2013-epiphany-2a776b7f4ea30e814b2703a50633143b5b0ebc95.tar.zst
gsoc2013-epiphany-2a776b7f4ea30e814b2703a50633143b5b0ebc95.zip
Make MozillaHistoryItem create url and title on demand.
Adapt code to the API change. svn path=/trunk/; revision=7835
Diffstat (limited to 'src/ephy-navigation-action.c')
-rw-r--r--src/ephy-navigation-action.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/ephy-navigation-action.c b/src/ephy-navigation-action.c
index 415294710..e977a4e2a 100644
--- a/src/ephy-navigation-action.c
+++ b/src/ephy-navigation-action.c
@@ -170,11 +170,13 @@ select_menu_item_cb (GtkWidget *menuitem,
char *url;
GtkWidget *statusbar;
EphyHistoryItem *item;
+ char *freeme = NULL;
item = (EphyHistoryItem*)g_object_get_data (G_OBJECT (menuitem), HISTORY_ITEM_DATA_KEY);
if (item)
{
url = ephy_history_item_get_url (item);
+ freeme = url;
}
else
{
@@ -185,6 +187,8 @@ select_menu_item_cb (GtkWidget *menuitem,
statusbar = ephy_window_get_statusbar (action->priv->window);
gtk_statusbar_push (GTK_STATUSBAR (statusbar), action->priv->statusbar_cid, url);
+
+ g_free (freeme);
}
static void
@@ -239,7 +243,7 @@ build_back_or_forward_menu (EphyNavigationAction *action)
{
GtkWidget *item;
EphyHistoryItem *hitem;
- const char *title, *url;
+ char *title, *url;
hitem = (EphyHistoryItem*)list->data;
url = ephy_history_item_get_url (hitem);
@@ -247,12 +251,11 @@ build_back_or_forward_menu (EphyNavigationAction *action)
item = new_history_menu_item (title ? title : url, url);
+ g_free (title);
+
g_object_set_data_full (G_OBJECT (item), HISTORY_ITEM_DATA_KEY, hitem,
(GDestroyNotify) g_object_unref);
- g_object_set_data_full (G_OBJECT (item), URL_DATA_KEY, g_strdup (url),
- (GDestroyNotify) g_free);
-
g_signal_connect (item, "activate",
G_CALLBACK (activate_back_or_forward_menu_item_cb),
action);