epiphany r7903 - trunk/src



Author: cosimoc
Date: Fri Feb  1 00:36:34 2008
New Revision: 7903
URL: http://svn.gnome.org/viewvc/epiphany?rev=7903&view=rev

Log:
Make middle clicking on Back/Forward toolbar buttons open again in
a new tab, as it was in 2.20. Bug #513029.


Modified:
   trunk/src/ephy-navigation-action.c

Modified: trunk/src/ephy-navigation-action.c
==============================================================================
--- trunk/src/ephy-navigation-action.c	(original)
+++ trunk/src/ephy-navigation-action.c	Fri Feb  1 00:36:34 2008
@@ -394,18 +394,44 @@
 
 	if (action->priv->direction == EPHY_NAVIGATION_DIRECTION_BACK)
 	{
-		ephy_embed_go_back (embed);
+		EphyHistoryItem *back_item;
+		char *url;
+		
+		back_item = ephy_embed_get_previous_history_item (embed);
+		if (back_item == NULL) return;
+
+		url = ephy_history_item_get_url (back_item);
+		ephy_link_open (EPHY_LINK (action),
+				url,
+				NULL,
+				ephy_gui_is_middle_click () ? EPHY_LINK_NEW_TAB : 0);
+		g_free (url);
 	}
 	else if (action->priv->direction == EPHY_NAVIGATION_DIRECTION_FORWARD)
 	{
-		ephy_embed_go_forward (embed);
+		EphyHistoryItem *forward_item;
+		char *url;
+		
+		forward_item = ephy_embed_get_next_history_item (embed);
+		if (forward_item == NULL) return;
+
+		url = ephy_history_item_get_url (forward_item);		
+		ephy_link_open (EPHY_LINK (action),
+				url,
+				NULL,
+				ephy_gui_is_middle_click () ? EPHY_LINK_NEW_TAB : 0);
+		g_free (url);
 	}
 	else if (action->priv->direction == EPHY_NAVIGATION_DIRECTION_UP)
 	{
+		GSList *up_list;
+		
+		up_list = ephy_embed_get_go_up_list (embed);
 		ephy_link_open (EPHY_LINK (action),
-				ephy_embed_get_go_up_list (embed)->data,
+				up_list->data,
 				NULL,
 				ephy_gui_is_middle_click () ? EPHY_LINK_NEW_TAB : 0);
+		g_slist_free (up_list);
 	}
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]