mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 19:13:40 +02:00
E-book viewer: Clear history when reloading the book, to avoid errors, since the locations pointed to by the history may no longer be valid anyway
This commit is contained in:
parent
3e2a75327a
commit
bcf619955b
2 changed files with 5 additions and 3 deletions
|
|
@ -955,6 +955,7 @@ def reload_book(self):
|
|||
reopen_at = self.current_page_bookmark
|
||||
except Exception:
|
||||
reopen_at = None
|
||||
self.history.clear()
|
||||
self.load_ebook(self.iterator.pathtoebook, reopen_at=reopen_at)
|
||||
return
|
||||
|
||||
|
|
|
|||
|
|
@ -106,14 +106,15 @@ def __init__(self, action_back=None, action_forward=None):
|
|||
self.action_back = action_back
|
||||
self.action_forward = action_forward
|
||||
super(History, self).__init__(self)
|
||||
self.clear()
|
||||
|
||||
def clear(self):
|
||||
del self[:]
|
||||
self.insert_pos = 0
|
||||
self.back_pos = None
|
||||
self.forward_pos = None
|
||||
self.set_actions()
|
||||
|
||||
def clear(self):
|
||||
del self[:]
|
||||
|
||||
def set_actions(self):
|
||||
if self.action_back is not None:
|
||||
self.action_back.setDisabled(self.back_pos is None)
|
||||
|
|
|
|||
Loading…
Reference in a new issue