diff options
| author | Dario Freddi <drf@kde.org> | 2009-10-15 14:18:05 +0200 | 
|---|---|---|
| committer | Andrea Diamantini <adjam7@gmail.com> | 2009-10-16 00:05:54 +0200 | 
| commit | 8b9594b68d04c11d04f00fdca2572c5ba2c90e9a (patch) | |
| tree | 7549361c99251f5868b147753e3369b2c7560f65 /src | |
| parent | Limit the history back menu to show only the last 8 entries (diff) | |
| download | rekonq-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')
| -rw-r--r-- | src/mainwindow.cpp | 7 | 
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      { | 
