Merge branch 'qutebrowser:master' into master

This commit is contained in:
mkonig 2022-02-01 09:30:35 +01:00 committed by GitHub
commit b9834afd69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 57 additions and 16 deletions

View File

@ -70,6 +70,13 @@ Fixed
shown when closing the last window (rather than closing any window, which
would continue running that window's downloads). Unfortunately, more issues
with `confirm_quit` and multiple windows remain.
- Crash when a previous crash-log file contains non-ASCII characters (which
should never happen unless it was edited manually)
- Due to changes in Debian, an old workaround (for broken QtWebEngine patching
on Debian) caused the inferior qutebrowser error page to be displayed, when
Chromium's would have worked fine. The workaround was now dropped.
- Crash when using `<Ctrl-D>` (`:completion-item-del`) in the `:tab-focus`
list, rather than `:tab-select`.
[[v2.4.1]]
v2.4.1 (unreleased)

View File

@ -4,6 +4,6 @@ build==0.7.0
check-manifest==0.47
packaging==21.3
pep517==0.12.0
pyparsing==3.0.6
pyparsing==3.0.7
toml==0.10.2
tomli==2.0.0

View File

@ -24,7 +24,7 @@ pkginfo==1.8.2
pycparser==2.21
Pygments==2.11.2
Pympler==1.0.1
pyparsing==3.0.6
pyparsing==3.0.7
PyQt-builder==1.12.2
python-dateutil==2.8.2
readme-renderer==32.0

View File

@ -12,7 +12,7 @@ Jinja2==3.0.3
MarkupSafe==2.0.1
packaging==21.3
Pygments==2.11.2
pyparsing==3.0.6
pyparsing==3.0.7
pytz==2021.3
requests==2.27.1
snowballstemmer==2.2.0

View File

@ -13,7 +13,7 @@ filelock==3.4.2 ; python_version>="3.7"
Flask==2.0.2
glob2==0.7
hunter==3.4.3
hypothesis==6.35.1 ; python_version>="3.7"
hypothesis==6.36.0 ; python_version>="3.7"
icdiff==2.0.4
idna==3.3
iniconfig==1.1.1
@ -26,13 +26,13 @@ manhole==1.8.0
more-itertools==8.12.0
packaging==21.3
parse==1.19.0
parse-type==0.5.2
parse-type==0.6.0
pluggy==1.0.0
pprintpp==0.4.0
py==1.11.0
py-cpuinfo==8.0.0
Pygments==2.11.2
pyparsing==3.0.6
pyparsing==3.0.7
pytest==6.2.5
pytest-bdd==4.1.0
pytest-benchmark==3.4.1

View File

@ -7,7 +7,7 @@ pip==21.3.1
platformdirs==2.4.1 ; python_version>="3.7"
pluggy==1.0.0
py==1.11.0
pyparsing==3.0.6
pyparsing==3.0.7
setuptools==60.5.0 ; python_version>="3.7"
six==1.16.0
toml==0.10.2

View File

@ -1530,7 +1530,6 @@ class WebEngineTab(browsertab.AbstractTab):
displayed.
WORKAROUND for https://bugreports.qt.io/browse/QTBUG-66643
WORKAROUND for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=882805
"""
match = re.search(r'"errorCode":"([^"]*)"', html)
if match is None:
@ -1539,8 +1538,7 @@ class WebEngineTab(browsertab.AbstractTab):
error = match.group(1)
log.webview.error("Load error: {}".format(error))
missing_jst = 'jstProcess(' in html and 'jstProcess=' not in html
if js_enabled and not missing_jst:
if js_enabled:
return
self._show_error_page(self.url(), error=error)

View File

@ -103,17 +103,23 @@ def session(*, info=None):
return model
def _tabs(*, win_id_filter=lambda _win_id: True, add_win_id=True):
def _tabs(*, win_id_filter=lambda _win_id: True, add_win_id=True, cur_win_id=None):
"""Helper to get the completion model for tabs/other_tabs.
Args:
win_id_filter: A filter function for window IDs to include.
Should return True for all included windows.
add_win_id: Whether to add the window ID to the completion items.
cur_win_id: Window ID to be passed from info.win_id
"""
def delete_tab(data):
"""Close the selected tab."""
win_id, tab_index = data[0].split('/')
if cur_win_id is None:
win_id, tab_index = data[0].split('/')
else:
win_id = cur_win_id
tab_index = data[0]
tabbed_browser = objreg.get('tabbed-browser', scope='window',
window=int(win_id))
tabbed_browser.on_tab_close_requested(int(tab_index) - 1)
@ -177,13 +183,15 @@ def other_tabs(*, info):
Used for the tab-take command.
"""
return _tabs(win_id_filter=lambda win_id: win_id != info.win_id)
return _tabs(
win_id_filter=lambda win_id: win_id != info.win_id,
cur_win_id=info.win_id)
def tab_focus(*, info):
"""A model to complete on open tabs in the current window."""
model = _tabs(win_id_filter=lambda win_id: win_id == info.win_id,
add_win_id=False)
add_win_id=False, cur_win_id=info.win_id)
special = [
("last", "Focus the last-focused tab"),

View File

@ -100,7 +100,7 @@ class CrashHandler(QObject):
# There's no log file, so we can use this to display crashes to
# the user on the next start.
self._init_crashlogfile()
except OSError:
except (OSError, UnicodeDecodeError):
log.init.exception("Error while handling crash log file!")
self._init_crashlogfile()

View File

@ -162,7 +162,7 @@ class WebserverProcess(testprocess.Process):
def _parse_line(self, line):
self._log(line)
started_re = re.compile(r' \* Running on https?://127\.0\.0\.1:{}/ '
started_re = re.compile(r' \* Running on https?://127\.0\.0\.1:{}/? '
r'\(Press CTRL\+C to quit\)'.format(self.port))
if started_re.fullmatch(line):
self.ready.emit()

View File

@ -867,6 +867,34 @@ def test_tab_completion_delete(qtmodeltester, fake_web_tab, win_registry,
QUrl('https://duckduckgo.com')]
def test_tab_focus_completion_delete(qtmodeltester, fake_web_tab, win_registry,
tabbed_browser_stubs, info):
"""Verify closing a tab by deleting it from the completion widget."""
tabbed_browser_stubs[0].widget.tabs = [
fake_web_tab(QUrl('https://github.com'), 'GitHub', 0),
fake_web_tab(QUrl('https://wikipedia.org'), 'Wikipedia', 1),
fake_web_tab(QUrl('https://duckduckgo.com'), 'DuckDuckGo', 2)
]
tabbed_browser_stubs[1].widget.tabs = [
fake_web_tab(QUrl('https://wiki.archlinux.org'), 'ArchWiki', 0),
]
model = miscmodels.tab_focus(info=info)
model.set_pattern('')
qtmodeltester.check(model)
parent = model.index(0, 0)
idx = model.index(1, 0, parent)
# sanity checks
assert model.data(parent) == "Tabs"
assert model.data(idx) == '2'
model.delete_cur_item(idx)
actual = [tab.url() for tab in tabbed_browser_stubs[0].widget.tabs]
assert actual == [QUrl('https://github.com'),
QUrl('https://duckduckgo.com')]
def test_tab_completion_not_sorted(qtmodeltester, fake_web_tab, win_registry,
tabbed_browser_stubs):
"""Ensure that the completion row order is the same as tab index order.