lazy sessions

This commit is contained in:
mhm@mhm.com 2017-11-18 00:48:31 +01:00
parent 95f8c07d7f
commit ade7004f8f
2 changed files with 8 additions and 4 deletions

View File

@ -424,6 +424,7 @@ def qute_settings(url):
confget=config.instance.get_str)
return 'text/html', html
@add_handler('back')
def qute_back(url):
"""Handler for qute://back. Simple page to free ram / lazy load a site,
@ -432,6 +433,7 @@ def qute_back(url):
html = jinja.render('back.html', title='Suspended')
return 'text/html', html
@add_handler('configdiff')
def qute_configdiff(url):
"""Handler for qute://configdiff."""

View File

@ -348,8 +348,8 @@ class SessionManager(QObject):
new_tab.data.pinned = histentry['pinned']
active = (histentry.get('active', False) and
(not config.val.session_lazy_restore or
histentry['url'].startswith('qute://')))
(not config.val.session_lazy_restore or
histentry['url'].startswith('qute://')))
url = QUrl.fromEncoded(histentry['url'].encode('ascii'))
if 'original-url' in histentry:
orig_url = QUrl.fromEncoded(
@ -370,8 +370,10 @@ class SessionManager(QObject):
active = last.get('active', False)
if not last['url'].startswith('qute://'):
entries.append(TabHistoryItem(url=QUrl.fromEncoded(url.encode('ascii')),
title=title, active=active, user_data={}))
entries.append(TabHistoryItem(
url=QUrl.fromEncoded(url.encode('ascii')),
title=title, active=active, user_data={}))
if active:
new_tab.title_changed.emit(title)