From 023fb3d093de1d672c6bea8c68c69e9d30d5a5d4 Mon Sep 17 00:00:00 2001 From: Dario Freddi Date: Thu, 15 Oct 2009 13:31:47 +0200 Subject: Limit the history back menu to show only the last 8 entries Signed-off-by: Dario Freddi --- src/mainwindow.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index cf8af892..79e20dbd 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1054,6 +1054,8 @@ void MainWindow::slotAboutToShowBackMenu() return; QWebHistory *history = currentTab()->history(); int historyCount = history->count(); + // Limit history views in the menu to 8 + int limit = 0; for (int i = history->backItems(historyCount).count() - 1; i >= 0; --i) { QWebHistoryItem item = history->backItems(history->count()).at(i); @@ -1063,6 +1065,10 @@ void MainWindow::slotAboutToShowBackMenu() action->setIcon(icon); action->setText(item.title()); m_historyBackMenu->addAction(action); + ++limit; + if (limit >= 8) { + break; + } } } -- cgit v1.2.1