summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDario Freddi <drf@kde.org>2009-10-15 13:31:47 +0200
committerDario Freddi <drf@kde.org>2009-10-15 13:44:12 +0200
commit023fb3d093de1d672c6bea8c68c69e9d30d5a5d4 (patch)
tree7c66b043b4af1e0f413f3ff6630cf50278c8cdac
parentrekonq 0.2.67 (diff)
downloadrekonq-023fb3d093de1d672c6bea8c68c69e9d30d5a5d4.tar.xz
Limit the history back menu to show only the last 8 entries
Signed-off-by: Dario Freddi <drf@kde.org>
-rw-r--r--src/mainwindow.cpp6
1 files changed, 6 insertions, 0 deletions
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;
+ }
}
}