Merge remote-tracking branch 'refs/remotes/origin/master'

This commit is contained in:
unknown 2017-12-07 13:36:49 -07:00
commit 2483b8315c
3 changed files with 11 additions and 8 deletions

View File

@ -1315,9 +1315,9 @@ tabs.title.format:
* `{scroll_pos}`: Page scroll position.
* `{host}`: Host of the current web page.
* `{backend}`: Either ''webkit'' or ''webengine''
* `{private}` : Indicates when private mode is enabled.
* `{current_url}` : URL of the current web page.
* `{protocol}` : Internet Protocol of the current web page.
* `{private}`: Indicates when private mode is enabled.
* `{current_url}`: URL of the current web page.
* `{protocol}`: Protocol (http/https/...) of the current web page
tabs.title.format_pinned:
default: '{index}'

View File

@ -165,6 +165,8 @@ class TabWidget(QTabWidget):
fields['perc_raw'] = tab.progress()
fields['backend'] = objects.backend.name
fields['private'] = ' [Private Mode] ' if tab.private else ''
url = self.tab_url(idx)
if tab.load_status() == usertypes.LoadStatus.loading:
fields['perc'] = '[{}%] '.format(tab.progress())
@ -172,19 +174,19 @@ class TabWidget(QTabWidget):
fields['perc'] = ''
try:
fields['host'] = self.tab_url(idx).host()
fields['host'] = url.host()
except qtutils.QtValueError:
fields['host'] = ''
try:
fields['current_url'] = self.tab_url(idx).url()
fields['current_url'] = url.url()
except qtutils.QtValueError:
fields['current_url'] = ''
try:
fields['protocol'] = self.tab_url(idx).scheme()
fields['protocol'] = url.scheme()
except qtutils.QtValueError:
fields['protocol']= ''
fields['protocol'] = ''
y = tab.scroller.pos_perc()[1]
if y is None:

View File

@ -131,11 +131,12 @@ class FakeUrl:
"""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.isValid = mock.Mock(returl_value=valid)
self.host = mock.Mock(returl_value=host)
self.url = mock.Mock(return_value=url)
self.scheme = mock.Mock(return_value=scheme)
class FakeNetworkReply: