forked from qt-creator/qt-creator
The backward menu logic was still broken.
This commit is contained in:
@@ -1063,12 +1063,12 @@ void HelpPlugin::slotAboutToShowBackMenu()
|
|||||||
{
|
{
|
||||||
m_backMenu->clear();
|
m_backMenu->clear();
|
||||||
if (QWebHistory *history = viewerForContextMode()->history()) {
|
if (QWebHistory *history = viewerForContextMode()->history()) {
|
||||||
const int count = history->count();
|
const int currentItemIndex = history->currentItemIndex();
|
||||||
QList<QWebHistoryItem> items = history->backItems(count);
|
QList<QWebHistoryItem> items = history->backItems(history->count());
|
||||||
for (int i = items.count() - 1; i >= 0; --i) {
|
for (int i = items.count() - 1; i >= 0; --i) {
|
||||||
QAction *action = new QAction(this);
|
QAction *action = new QAction(this);
|
||||||
action->setText(items.at(i).title());
|
action->setText(items.at(i).title());
|
||||||
action->setData(-1 * (count - i - 1));
|
action->setData(-1 * (currentItemIndex - i));
|
||||||
m_backMenu->addAction(action);
|
m_backMenu->addAction(action);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user