diff options
author | Florian Bruhin <git@the-compiler.org> | 2017-03-07 06:43:05 +0100 |
---|---|---|
committer | Florian Bruhin <git@the-compiler.org> | 2017-03-07 20:28:56 +0100 |
commit | 272553815518fd2976e531da8b51d06d0ea856e7 (patch) | |
tree | 1c29ed194cd0e9023f6f82fdb79c7d4feea3b23a | |
parent | b1f3c19fc654eb38df0104c2e647ffffe5e683bb (diff) | |
download | qutebrowser-272553815518fd2976e531da8b51d06d0ea856e7.tar.gz qutebrowser-272553815518fd2976e531da8b51d06d0ea856e7.zip |
Reorder initialization
marcos.init() really belongs into _init_modules, and we need to do _process_args
after everything has been initialized.
Fixes #2408.
(cherry picked from commit d42dff67f23ea1ff8ab9869517ca03bf3a9afc6d)
-rw-r--r-- | qutebrowser/app.py | 7 | ||||
-rw-r--r-- | tests/end2end/test_invocations.py | 12 |
2 files changed, 15 insertions, 4 deletions
diff --git a/qutebrowser/app.py b/qutebrowser/app.py index 09b2adfc1..aa9666d74 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -142,8 +142,6 @@ def init(args, crash_handler): pre_text="Error while initializing") sys.exit(usertypes.Exit.err_init) - _process_args(args) - log.init.debug("Initializing eventfilter...") event_filter = EventFilter(qApp) qApp.installEventFilter(event_filter) @@ -154,12 +152,12 @@ def init(args, crash_handler): config_obj.style_changed.connect(style.get_stylesheet.cache_clear) qApp.focusChanged.connect(on_focus_changed) + _process_args(args) + QDesktopServices.setUrlHandler('http', open_desktopservices_url) QDesktopServices.setUrlHandler('https', open_desktopservices_url) QDesktopServices.setUrlHandler('qute', open_desktopservices_url) - macros.init() - QTimer.singleShot(10, functools.partial(_init_late_modules, args)) log.init.debug("Init done!") @@ -449,6 +447,7 @@ def _init_modules(args, crash_handler): os.environ['QT_WAYLAND_DISABLE_WINDOWDECORATION'] = '1' else: os.environ.pop('QT_WAYLAND_DISABLE_WINDOWDECORATION', None) + macros.init() # Init backend-specific stuff browsertab.init() diff --git a/tests/end2end/test_invocations.py b/tests/end2end/test_invocations.py index 253b4b236..bcb8b04e6 100644 --- a/tests/end2end/test_invocations.py +++ b/tests/end2end/test_invocations.py @@ -249,3 +249,15 @@ def test_webengine_download_suffix(request, quteproc_new, tmpdir): files = download_dir.listdir() assert len(files) == 1 assert files[0].basename == 'download.bin' + + +def test_command_on_start(request, quteproc_new): + """Make sure passing a command on start works. + + See https://github.com/qutebrowser/qutebrowser/issues/2408 + """ + args = (['--temp-basedir'] + _base_args(request.config) + + [':quickmark-add https://www.example.com/ example']) + quteproc_new.start(args) + quteproc_new.send_cmd(':quit') + quteproc_new.wait_for_quit() |