summaryrefslogtreecommitdiff
path: root/src/tabwindow
diff options
context:
space:
mode:
Diffstat (limited to 'src/tabwindow')
-rw-r--r--src/tabwindow/tabwindow.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/tabwindow/tabwindow.cpp b/src/tabwindow/tabwindow.cpp
index a37cc249..beb087c5 100644
--- a/src/tabwindow/tabwindow.cpp
+++ b/src/tabwindow/tabwindow.cpp
@@ -449,9 +449,9 @@ void TabWindow::cloneTab(int index)
QUrl u = webWindow(index)->url();
QWebHistory* history = webWindow(index)->page()->history();
- TabHistory tHistory(history);
+ TabHistory clonedHistory(history);
- loadUrl(u, Rekonq::NewTab, &tHistory);
+ loadUrl(u, Rekonq::NewTab, &clonedHistory);
}
@@ -483,7 +483,8 @@ void TabWindow::closeTab(int index, bool del)
TabHistory history(tabToClose->page()->history());
history.title = tabToClose->title();
history.url = tabToClose->url().url();
-
+ history.position = index;
+
m_recentlyClosedTabs.removeAll(history);
if (m_recentlyClosedTabs.count() == recentlyClosedTabsLimit)
m_recentlyClosedTabs.removeLast();
@@ -610,7 +611,18 @@ void TabWindow::restoreLastClosedTab()
QUrl u = QUrl(history.url);
- loadUrl(u, Rekonq::NewFocusedTab, &history);
+ int restorePosition = history.position;
+
+ WebWindow *tab = prepareNewTab();
+
+ if (restorePosition < count())
+ insertTab(restorePosition, tab, i18n("restored tab"));
+ else
+ addTab(tab, i18n("restored tab"));
+
+ setCurrentWidget(tab);
+
+ tab->load(u);
// just to get sure...
m_recentlyClosedTabs.removeAll(history);