From 27aa40428eb6a6651d5125e470560ba0ea32ddbb Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 16 May 2017 11:32:35 +0200 Subject: [PATCH] Also make DownloadManager NAM private if private browsing is on There's only one global DownloadManager with its own NAM (for downloads not associated with a page). We can't really decide whether that should be private or not, so as a best-effort approximation we simply make it private if private browsing was turned on when starting qutebrowser. --- qutebrowser/browser/qtnetworkdownloads.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qutebrowser/browser/qtnetworkdownloads.py b/qutebrowser/browser/qtnetworkdownloads.py index 5fb0ed163..71039dc2d 100644 --- a/qutebrowser/browser/qtnetworkdownloads.py +++ b/qutebrowser/browser/qtnetworkdownloads.py @@ -27,6 +27,7 @@ import collections from PyQt5.QtCore import pyqtSlot, pyqtSignal, QTimer from PyQt5.QtNetwork import QNetworkRequest, QNetworkReply +from qutebrowser.config import config from qutebrowser.utils import message, usertypes, log, urlutils, utils from qutebrowser.browser import downloads from qutebrowser.browser.webkit import http @@ -366,7 +367,8 @@ class DownloadManager(downloads.AbstractDownloadManager): def __init__(self, win_id, parent=None): super().__init__(parent) self._networkmanager = networkmanager.NetworkManager( - win_id=win_id, tab_id=None, private=False, parent=self) + win_id=win_id, tab_id=None, + private=config.get('general', 'private-browsing'), parent=self) @pyqtSlot('QUrl') def get(self, url, *, user_agent=None, **kwargs):