From 0cf36e2dc0ec83bb71431ec72d26d833d55132d0 Mon Sep 17 00:00:00 2001
From: kh1 <qt-info@nokia.com>
Date: Wed, 25 Aug 2010 17:15:18 +0200
Subject: [PATCH] The backward menu logic was still broken.

---
 src/plugins/help/helpplugin.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp
index 8d5a983860e..0820da9276e 100644
--- a/src/plugins/help/helpplugin.cpp
+++ b/src/plugins/help/helpplugin.cpp
@@ -1063,12 +1063,12 @@ void HelpPlugin::slotAboutToShowBackMenu()
 {
     m_backMenu->clear();
     if (QWebHistory *history = viewerForContextMode()->history()) {
-        const int count = history->count();
-        QList<QWebHistoryItem> items = history->backItems(count);
+        const int currentItemIndex = history->currentItemIndex();
+        QList<QWebHistoryItem> items = history->backItems(history->count());
         for (int i = items.count() - 1; i >= 0; --i) {
             QAction *action = new QAction(this);
             action->setText(items.at(i).title());
-            action->setData(-1 * (count - i - 1));
+            action->setData(-1 * (currentItemIndex - i));
             m_backMenu->addAction(action);
         }
     }
-- 
GitLab