From 6f8eb419ae96804d4c43a4caf8987a47feebe78b Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 15 Mar 2018 14:51:03 +0100 Subject: [PATCH] Emit predicted_navigation when loading sessions This avoids reloads (because of changed settings) after a session has been loaded. Related to #3718 --- qutebrowser/browser/webengine/webenginetab.py | 3 +++ qutebrowser/browser/webkit/webkittab.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index e9423043b..87adbc81e 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -506,6 +506,9 @@ class WebEngineHistory(browsertab.AbstractHistory): return qtutils.deserialize(data, self._history) def load_items(self, items): + if items: + self._tab.predicted_navigation.emit(items[-1].url) + stream, _data, cur_data = tabhistory.serialize(items) qtutils.deserialize_stream(stream, self._history) diff --git a/qutebrowser/browser/webkit/webkittab.py b/qutebrowser/browser/webkit/webkittab.py index ac2610f5f..29dd5f03b 100644 --- a/qutebrowser/browser/webkit/webkittab.py +++ b/qutebrowser/browser/webkit/webkittab.py @@ -537,6 +537,9 @@ class WebKitHistory(browsertab.AbstractHistory): return qtutils.deserialize(data, self._history) def load_items(self, items): + if items: + self._tab.predicted_navigation.emit(items[-1].url) + stream, _data, user_data = tabhistory.serialize(items) qtutils.deserialize_stream(stream, self._history) for i, data in enumerate(user_data):