Disable QtNetwork cache on Qt 5.8

See #2427
This commit is contained in:
Florian Bruhin 2017-04-03 17:48:12 +02:00
parent 8f82113748
commit 1b0ea19ca4
2 changed files with 6 additions and 1 deletions

View File

@ -37,6 +37,8 @@ Changed
- PAC on QtWebKit now supports SOCKS5 as type.
- Comments in the config file are now before the individual
options instead of being before sections.
- The HTTP cache is disabled with QtWebKit on Qt 5.8 now as it leads to frequent
crashes due to a Qt bug.
Fixed
~~~~~

View File

@ -25,7 +25,7 @@ from PyQt5.QtCore import pyqtSlot
from PyQt5.QtNetwork import QNetworkDiskCache, QNetworkCacheMetaData
from qutebrowser.config import config
from qutebrowser.utils import utils, objreg
from qutebrowser.utils import utils, objreg, qtutils
class DiskCache(QNetworkDiskCache):
@ -53,6 +53,9 @@ class DiskCache(QNetworkDiskCache):
size = config.get('storage', 'cache-size')
if size is None:
size = 1024 * 1024 * 50 # default from QNetworkDiskCachePrivate
# WORKAROUND for https://github.com/qutebrowser/qutebrowser/issues/2427
if qtutils.version_check('5.8', exact=True):
size = 0
self.setMaximumCacheSize(size)
def _maybe_activate(self):