Don't setMaximumCacheSize if there is no cache

This commit is contained in:
Lamar Pavel 2015-10-21 14:12:05 +02:00
parent a99d3f6525
commit da800e3fa7

View File

@ -43,7 +43,6 @@ class DiskCache(QNetworkDiskCache):
self._cache_dir = cache_dir
self._http_cache_dir = os.path.join(cache_dir, 'http')
self._maybe_activate()
self.setMaximumCacheSize(config.get('storage', 'cache-size'))
objreg.get('config').changed.connect(self.on_config_changed)
def __repr__(self):
@ -59,6 +58,7 @@ class DiskCache(QNetworkDiskCache):
else:
self._activated = True
self.setCacheDirectory(self._http_cache_dir)
self.setMaximumCacheSize(config.get('storage', 'cache-size'))
@pyqtSlot(str, str)
def on_config_changed(self, section, option):