]> spindle.queued.net Git - midori/commitdiff
Use the right index for Undo Close Tab.
authorChristian Dywan <christian@twotoasts.de>
Sun, 24 Aug 2008 01:05:00 +0000 (03:05 +0200)
committerChristian Dywan <christian@twotoasts.de>
Sun, 24 Aug 2008 01:05:00 +0000 (03:05 +0200)
midori/midori-browser.c

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