Fix loading of sessions

This commit is contained in:
Florian Bruhin 2016-07-04 15:18:49 +02:00
parent a62e2a0c27
commit 4de48620e3
2 changed files with 6 additions and 5 deletions

View File

@ -20,15 +20,16 @@
"""Wrapper over our (QtWebKit) WebView."""
import sys
import functools
import xml.etree.ElementTree
from PyQt5.QtCore import pyqtSlot, Qt, QEvent, QUrl
from PyQt5.QtCore import pyqtSlot, Qt, QEvent, QUrl, QPoint, QTimer
from PyQt5.QtGui import QKeyEvent
from PyQt5.QtWebKitWidgets import QWebPage
from PyQt5.QtWebKit import QWebSettings
from qutebrowser.browser import tab
from qutebrowser.browser.webkit import webview
from qutebrowser.browser.webkit import webview, tabhistory
from qutebrowser.utils import qtutils, objreg, usertypes, utils
@ -430,7 +431,7 @@ class WebViewHistory(tab.AbstractHistory):
if ('scroll-pos' in cur_data and
self._tab.scroll.pos_px() == QPoint(0, 0)):
QTimer.singleShot(0, functools.partial(
self._tab.scroll, cur_data['scroll-pos']))
self._tab.scroll.to_point, cur_data['scroll-pos']))
class WebViewTab(tab.AbstractTab):

View File

@ -299,9 +299,9 @@ class SessionManager(QObject):
active=active, user_data=user_data)
entries.append(entry)
if active:
new_tab.titleChanged.emit(histentry['title'])
new_tab.title_changed.emit(histentry['title'])
try:
new_tab.page().load_history(entries)
new_tab.history.load_items(entries)
except ValueError as e:
raise SessionError(e)