Use the right index for Undo Close Tab.

This commit is contained in:
Christian Dywan 2008-08-24 03:05:00 +02:00
parent 74a587f5e8
commit 1dfebf6c7f

View file

@ -2650,10 +2650,14 @@ static void
_action_undo_tab_close_activate (GtkAction* action, _action_undo_tab_close_activate (GtkAction* action,
MidoriBrowser* browser) MidoriBrowser* browser)
{ {
guint last;
KatzeXbelItem* item;
guint n;
/* Reopen the most recent trash item */ /* Reopen the most recent trash item */
guint length = midori_web_list_get_length (browser->trash); last = midori_web_list_get_length (browser->trash) - 1;
KatzeXbelItem* item = midori_web_list_get_nth_item (browser->trash, length); item = midori_web_list_get_nth_item (browser->trash, last);
gint n = midori_browser_add_xbel_item (browser, item); n = midori_browser_add_xbel_item (browser, item);
midori_browser_set_current_page (browser, n); midori_browser_set_current_page (browser, n);
midori_web_list_remove_item (browser->trash, item); midori_web_list_remove_item (browser->trash, item);
_midori_browser_update_actions (browser); _midori_browser_update_actions (browser);