eric6/Helpviewer/Network/NetworkDiskCache.py

branch
maintenance
changeset 7286
7eb04391adf7
parent 7226
babe80d84a3e
parent 7285
1ff497f33f31
child 7287
1c17f2191bdd
equal deleted inserted replaced
7226:babe80d84a3e 7286:7eb04391adf7
1 # -*- coding: utf-8 -*-
2
3 # Copyright (c) 2009 - 2019 Detlev Offenbach <detlev@die-offenbachs.de>
4 #
5
6 """
7 Module implementing a disk cache respecting privacy.
8 """
9
10 from __future__ import unicode_literals
11
12 from PyQt5.QtWebKit import QWebSettings
13 from PyQt5.QtNetwork import QNetworkDiskCache
14
15
16 class NetworkDiskCache(QNetworkDiskCache):
17 """
18 Class implementing a disk cache respecting privacy.
19 """
20 def prepare(self, metaData):
21 """
22 Public method to prepare the disk cache file.
23
24 @param metaData meta data for a URL (QNetworkCacheMetaData)
25 @return reference to the IO device (QIODevice)
26 """
27 if QWebSettings.globalSettings().testAttribute(
28 QWebSettings.PrivateBrowsingEnabled):
29 return None
30
31 return QNetworkDiskCache.prepare(self, metaData)

eric ide

mercurial