viewer: handle recently opened list when started without a book

When starting ebook-viewer standalone without a book, set_book_path has
never been called and there is no pathtoebook attribute yet. In this
case, we certainly don't need to compare it to the current book.
This commit is contained in:
Eli Schwartz 2020-03-27 12:12:09 -04:00
parent 1e742f711f
commit e3d073589b
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6

View File

@ -250,7 +250,7 @@ class ActionsToolBar(ToolBar):
path = os.path.abspath(entry['pathtoebook'])
except Exception:
continue
if path == os.path.abspath(set_book_path.pathtoebook):
if hasattr(set_book_path, 'pathtoebook') and path == os.path.abspath(set_book_path.pathtoebook):
continue
m.addAction('{}\t {}'.format(
elided_text(entry['title'], pos='right', width=250),