Never get downloads from the cache.

This is a workaround for corrupted files because Qt somehow reads them from the
cache wrongly. See https://bugreports.qt-project.org/browse/QTBUG-42757

This might fix a part of #78 - but we'll leave this open for now, since it
might also be another issue.
This commit is contained in:
Florian Bruhin 2014-11-19 19:43:07 +01:00
parent b8b31fd914
commit 283cedff15

View File

@ -411,6 +411,10 @@ class DownloadManager(QAbstractListModel):
urlutils.invalid_url_error(self._win_id, url, "start download")
return
req = QNetworkRequest(url)
# WORKAROUND for Qt corrupting data loaded from cache:
# https://bugreports.qt-project.org/browse/QTBUG-42757
req.setAttribute(QNetworkRequest.CacheLoadControlAttribute,
QNetworkRequest.AlwaysNetwork)
if page is None:
nam = self._networkmanager
else: