Viewer: use absolute file paths for books passed in on the command line.

This allows them to be re-opened via the Open Books screen even if the
viewer was launched from a different starting directory.
This commit is contained in:
Kovid Goyal 2019-10-18 18:52:34 +05:30
parent 45f55d8a44
commit 1b0efe04d9
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -206,7 +206,7 @@ def main(args=sys.argv):
main = EbookViewer(open_at=opts.open_at, continue_reading=opts.continue_reading) main = EbookViewer(open_at=opts.open_at, continue_reading=opts.continue_reading)
main.set_exception_handler() main.set_exception_handler()
if len(args) > 1: if len(args) > 1:
acc.events.append(args[-1]) acc.events.append(os.path.abspath(args[-1]))
acc.got_file.connect(main.handle_commandline_arg) acc.got_file.connect(main.handle_commandline_arg)
main.show() main.show()
main.msg_from_anotherinstance.connect(main.another_instance_wants_to_talk, type=Qt.QueuedConnection) main.msg_from_anotherinstance.connect(main.another_instance_wants_to_talk, type=Qt.QueuedConnection)