summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mainview.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mainview.cpp b/src/mainview.cpp
index 699103a0..66c86bc5 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -462,10 +462,13 @@ void MainView::closeTab(int index, bool del)
&& !QWebSettings::globalSettings()->testAttribute(QWebSettings::PrivateBrowsingEnabled)
)
{
+ const int recentlyClosedTabsLimit = 10;
QString title = tabToClose->view()->title();
QString url = tabToClose->url().prettyUrl();
HistoryItem item(url, QDateTime(), title);
m_recentlyClosedTabs.removeAll(item);
+ if (m_recentlyClosedTabs.count() == recentlyClosedTabsLimit)
+ m_recentlyClosedTabs.removeLast();
m_recentlyClosedTabs.prepend(item);
}