Initialize QtWebKit-specific stuff with QtWebKit only
Maybe this fixes issues we had with QtWebEngine segfaults in proxy.py on Travis? Note we can't move cookies/cache/network stuff yet as we still need that for e.g. adblock downloads with QtWebEngine.
This commit is contained in:
parent
f9c35329df
commit
f6aefabf40
@ -47,8 +47,7 @@ from qutebrowser.commands import cmdutils, runners, cmdexc
|
||||
from qutebrowser.config import style, config, websettings, configexc
|
||||
from qutebrowser.browser import urlmarks, adblock, history, browsertab
|
||||
from qutebrowser.browser.webkit import cookies, cache, downloads
|
||||
from qutebrowser.browser.webkit.network import (webkitqutescheme, proxy,
|
||||
networkmanager)
|
||||
from qutebrowser.browser.webkit.network import networkmanager
|
||||
from qutebrowser.mainwindow import mainwindow
|
||||
from qutebrowser.misc import (readline, ipc, savemanager, sessions,
|
||||
crashsignal, earlyinit)
|
||||
@ -399,10 +398,6 @@ def _init_modules(args, crash_handler):
|
||||
log.init.debug("Initializing sessions...")
|
||||
sessions.init(qApp)
|
||||
|
||||
log.init.debug("Initializing js-bridge...")
|
||||
js_bridge = webkitqutescheme.JSBridge(qApp)
|
||||
objreg.register('js-bridge', js_bridge)
|
||||
|
||||
log.init.debug("Initializing websettings...")
|
||||
websettings.init()
|
||||
|
||||
@ -419,9 +414,6 @@ def _init_modules(args, crash_handler):
|
||||
bookmark_manager = urlmarks.BookmarkManager(qApp)
|
||||
objreg.register('bookmark-manager', bookmark_manager)
|
||||
|
||||
log.init.debug("Initializing proxy...")
|
||||
proxy.init()
|
||||
|
||||
log.init.debug("Initializing cookies...")
|
||||
cookie_jar = cookies.CookieJar(qApp)
|
||||
ram_cookie_jar = cookies.RAMCookieJar(qApp)
|
||||
@ -716,7 +708,6 @@ class Quitter:
|
||||
atexit.register(shutil.rmtree, self._args.basedir,
|
||||
ignore_errors=True)
|
||||
# Delete temp download dir
|
||||
objreg.get('temporary-downloads').cleanup()
|
||||
# If we don't kill our custom handler here we might get segfaults
|
||||
log.destroy.debug("Deactivating message handler...")
|
||||
qInstallMessageHandler(None)
|
||||
|
@ -26,19 +26,27 @@ import xml.etree.ElementTree
|
||||
from PyQt5.QtCore import (pyqtSlot, Qt, QEvent, QUrl, QPoint, QTimer, QSizeF,
|
||||
QSize)
|
||||
from PyQt5.QtGui import QKeyEvent
|
||||
from PyQt5.QtWidgets import QApplication
|
||||
from PyQt5.QtWebKitWidgets import QWebPage, QWebFrame
|
||||
from PyQt5.QtWebKit import QWebSettings
|
||||
from PyQt5.QtPrintSupport import QPrinter
|
||||
|
||||
from qutebrowser.browser import browsertab
|
||||
from qutebrowser.browser.webkit import webview, tabhistory, webkitelem
|
||||
from qutebrowser.utils import qtutils, objreg, usertypes, utils, log
|
||||
from qutebrowser.browser.webkit import webview, tabhistory, webkitelem, cache
|
||||
from qutebrowser.browser.webkit.network import proxy, webkitqutescheme
|
||||
from qutebrowser.utils import qtutils, objreg, usertypes, utils, log, standarddir
|
||||
|
||||
|
||||
def init():
|
||||
"""Initialize QtWebKit-specific modules."""
|
||||
# FIXME:qtwebengine Move things we don't need with QtWebEngine here.
|
||||
pass
|
||||
qapp = QApplication.instance()
|
||||
|
||||
log.init.debug("Initializing proxy...")
|
||||
proxy.init()
|
||||
|
||||
log.init.debug("Initializing js-bridge...")
|
||||
js_bridge = webkitqutescheme.JSBridge(qapp)
|
||||
objreg.register('js-bridge', js_bridge)
|
||||
|
||||
|
||||
class WebKitPrinting(browsertab.AbstractPrinting):
|
||||
|
Loading…
Reference in New Issue
Block a user