Fix :undo

This commit is contained in:
Florian Bruhin 2016-07-04 12:48:29 +02:00
parent aebc29337a
commit b0ba2125a3
2 changed files with 4 additions and 1 deletions

View File

@ -329,6 +329,9 @@ class AbstractHistory:
self._tab = tab self._tab = tab
self.history = None self.history = None
def __len__(self):
return len(self.history)
def __iter__(self): def __iter__(self):
return iter(self.history.items()) return iter(self.history.items())

View File

@ -291,7 +291,7 @@ class TabbedBrowser(tabwidget.TabWidget):
use_current_tab = False use_current_tab = False
if last_close in ['blank', 'startpage', 'default-page']: if last_close in ['blank', 'startpage', 'default-page']:
only_one_tab_open = self.count() == 1 only_one_tab_open = self.count() == 1
no_history = self.widget(0).history().count() == 1 no_history = len(self.widget(0).history) == 1
urls = { urls = {
'blank': QUrl('about:blank'), 'blank': QUrl('about:blank'),
'startpage': QUrl(config.get('general', 'startpage')[0]), 'startpage': QUrl(config.get('general', 'startpage')[0]),