--- a/eric6/WebBrowser/Navigation/NavigationBar.py Sun Apr 11 11:34:32 2021 +0200 +++ b/eric6/WebBrowser/Navigation/NavigationBar.py Sun Apr 11 12:38:16 2021 +0200 @@ -233,22 +233,16 @@ """ self.__backMenu.clear() history = self.__mw.currentBrowser().history() - historyCount = history.count() - backItems = history.backItems(historyCount) + backItems = history.backItems(20) + # show max. 20 items - count = 0 - for index in range(len(backItems) - 1, -1, -1): - item = backItems[index] + for item in reversed(backItems): act = QAction(self) act.setData(item) icon = WebBrowserWindow.icon(item.url()) act.setIcon(icon) act.setText(item.title()) self.__backMenu.addAction(act) - - count += 1 - if count == 20: - break self.__backMenu.addSeparator() self.__backMenu.addAction(self.tr("Clear History"), @@ -260,22 +254,16 @@ """ self.__forwardMenu.clear() history = self.__mw.currentBrowser().history() - historyCount = history.count() - forwardItems = history.forwardItems(historyCount) + forwardItems = history.forwardItems(20) + # show max. 20 items - count = 0 - for index in range(len(forwardItems)): - item = forwardItems[index] + for item in forwardItems: act = QAction(self) act.setData(item) icon = WebBrowserWindow.icon(item.url()) act.setIcon(icon) act.setText(item.title()) self.__forwardMenu.addAction(act) - - count += 1 - if count == 20: - break self.__forwardMenu.addSeparator() self.__forwardMenu.addAction(self.tr("Clear History"),