Merge remote-tracking branch 'origin/pr/3370'
This commit is contained in:
commit
6c7b8ce895
@ -1300,6 +1300,7 @@ tabs.title.format:
|
|||||||
- host
|
- host
|
||||||
- private
|
- private
|
||||||
- current_url
|
- current_url
|
||||||
|
- protocol
|
||||||
none_ok: true
|
none_ok: true
|
||||||
desc: |
|
desc: |
|
||||||
Format to use for the tab title.
|
Format to use for the tab title.
|
||||||
@ -1316,6 +1317,7 @@ tabs.title.format:
|
|||||||
* `{backend}`: Either ''webkit'' or ''webengine''
|
* `{backend}`: Either ''webkit'' or ''webengine''
|
||||||
* `{private}`: Indicates when private mode is enabled.
|
* `{private}`: Indicates when private mode is enabled.
|
||||||
* `{current_url}`: URL of the current web page.
|
* `{current_url}`: URL of the current web page.
|
||||||
|
* `{protocol}`: Protocol (http/https/...) of the current web page
|
||||||
|
|
||||||
tabs.title.format_pinned:
|
tabs.title.format_pinned:
|
||||||
default: '{index}'
|
default: '{index}'
|
||||||
@ -1332,6 +1334,7 @@ tabs.title.format_pinned:
|
|||||||
- host
|
- host
|
||||||
- private
|
- private
|
||||||
- current_url
|
- current_url
|
||||||
|
- protocol
|
||||||
none_ok: true
|
none_ok: true
|
||||||
desc: Format to use for the tab title for pinned tabs. The same placeholders
|
desc: Format to use for the tab title for pinned tabs. The same placeholders
|
||||||
like for `tabs.title.format` are defined.
|
like for `tabs.title.format` are defined.
|
||||||
@ -1475,6 +1478,7 @@ window.title_format:
|
|||||||
- backend
|
- backend
|
||||||
- private
|
- private
|
||||||
- current_url
|
- current_url
|
||||||
|
- protocol
|
||||||
default: '{perc}{title}{title_sep}qutebrowser'
|
default: '{perc}{title}{title_sep}qutebrowser'
|
||||||
desc: |
|
desc: |
|
||||||
Format to use for the window title. The same placeholders like for
|
Format to use for the window title. The same placeholders like for
|
||||||
|
@ -172,14 +172,15 @@ class TabWidget(QTabWidget):
|
|||||||
fields['perc'] = ''
|
fields['perc'] = ''
|
||||||
|
|
||||||
try:
|
try:
|
||||||
fields['host'] = self.tab_url(idx).host()
|
url = self.tab_url(idx)
|
||||||
except qtutils.QtValueError:
|
except qtutils.QtValueError:
|
||||||
fields['host'] = ''
|
fields['host'] = ''
|
||||||
|
|
||||||
try:
|
|
||||||
fields['current_url'] = self.tab_url(idx).url()
|
|
||||||
except qtutils.QtValueError:
|
|
||||||
fields['current_url'] = ''
|
fields['current_url'] = ''
|
||||||
|
fields['protocol'] = ''
|
||||||
|
else:
|
||||||
|
fields['host'] = url.host()
|
||||||
|
fields['current_url'] = url.toDisplayString()
|
||||||
|
fields['protocol'] = url.scheme()
|
||||||
|
|
||||||
y = tab.scroller.pos_perc()[1]
|
y = tab.scroller.pos_perc()[1]
|
||||||
if y is None:
|
if y is None:
|
||||||
|
@ -131,11 +131,13 @@ class FakeUrl:
|
|||||||
|
|
||||||
"""QUrl stub which provides .path(), isValid() and host()."""
|
"""QUrl stub which provides .path(), isValid() and host()."""
|
||||||
|
|
||||||
def __init__(self, path=None, valid=True, host=None, url=None):
|
def __init__(self, path=None, valid=True, host=None, url=None,
|
||||||
|
scheme=None):
|
||||||
self.path = mock.Mock(return_value=path)
|
self.path = mock.Mock(return_value=path)
|
||||||
self.isValid = mock.Mock(returl_value=valid)
|
self.isValid = mock.Mock(returl_value=valid)
|
||||||
self.host = mock.Mock(returl_value=host)
|
self.host = mock.Mock(returl_value=host)
|
||||||
self.url = mock.Mock(return_value=url)
|
self.toDisplayString = mock.Mock(return_value=url)
|
||||||
|
self.scheme = mock.Mock(return_value=scheme)
|
||||||
|
|
||||||
|
|
||||||
class FakeNetworkReply:
|
class FakeNetworkReply:
|
||||||
|
Loading…
Reference in New Issue
Block a user