From 1b0efe04d97a5815fdfbc837fbec80e9593884d7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 18 Oct 2019 18:52:34 +0530 Subject: [PATCH] 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. --- src/calibre/gui2/viewer/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/viewer/main.py b/src/calibre/gui2/viewer/main.py index fcdec18fde..a83ae48d94 100644 --- a/src/calibre/gui2/viewer/main.py +++ b/src/calibre/gui2/viewer/main.py @@ -206,7 +206,7 @@ def main(args=sys.argv): main = EbookViewer(open_at=opts.open_at, continue_reading=opts.continue_reading) main.set_exception_handler() 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) main.show() main.msg_from_anotherinstance.connect(main.another_instance_wants_to_talk, type=Qt.QueuedConnection)