mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04: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
@ -955,6 +955,7 @@ class EbookViewer(MainWindow):
|
||||
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 @@ class History(list): # {{{
|
||||
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…
x
Reference in New Issue
Block a user