summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorDario Freddi <drf@kde.org>2009-10-15 14:18:05 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-10-16 00:05:54 +0200
commit8b9594b68d04c11d04f00fdca2572c5ba2c90e9a (patch)
tree7549361c99251f5868b147753e3369b2c7560f65 /src/mainwindow.cpp
parentLimit the history back menu to show only the last 8 entries (diff)
downloadrekonq-8b9594b68d04c11d04f00fdca2572c5ba2c90e9a.tar.xz
Fix a bug where the history index goes wrong after the first turning back. This bug was present also before my previous commit
Signed-off-by: Dario Freddi <drf@kde.org>
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 79e20dbd..7f2bcdeb 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -1058,9 +1058,10 @@ void MainWindow::slotAboutToShowBackMenu()
int limit = 0;
for (int i = history->backItems(historyCount).count() - 1; i >= 0; --i)
{
+ qDebug() << history->currentItemIndex();
QWebHistoryItem item = history->backItems(history->count()).at(i);
KAction *action = new KAction(this);
- action->setData(-1*(historyCount - i - 1));
+ action->setData(history->currentItemIndex() - (i + 1));
QIcon icon = Application::icon(item.url());
action->setIcon(icon);
action->setText(item.title());
@@ -1077,9 +1078,11 @@ void MainWindow::slotOpenActionUrl(QAction *action)
{
int offset = action->data().toInt();
QWebHistory *history = currentTab()->history();
+ qDebug() << offset;
+ qDebug() << history->itemAt(offset).isValid();
if (offset < 0)
{
- history->goToItem(history->backItems(-1*offset).first()); // back
+ history->goToItem(history->itemAt(offset)); // back
}
else
{