22 ExpirableNetworkDiskCache QgsNetworkDiskCache::sDiskCache;
24 QMutex QgsNetworkDiskCache::sDiskCacheMutex;
26 QgsNetworkDiskCache::QgsNetworkDiskCache( QObject *parent )
27 : QNetworkDiskCache( parent )
33 const QMutexLocker lock( &sDiskCacheMutex );
34 return sDiskCache.cacheDirectory();
39 const QMutexLocker lock( &sDiskCacheMutex );
40 sDiskCache.setCacheDirectory( cacheDir );
45 const QMutexLocker lock( &sDiskCacheMutex );
46 return sDiskCache.maximumCacheSize();
51 const QMutexLocker lock( &sDiskCacheMutex );
52 sDiskCache.setMaximumCacheSize( size );
57 const QMutexLocker lock( &sDiskCacheMutex );
58 return sDiskCache.cacheSize();
63 const QMutexLocker lock( &sDiskCacheMutex );
64 return sDiskCache.metaData( url );
69 const QMutexLocker lock( &sDiskCacheMutex );
70 sDiskCache.updateMetaData(
metaData );
75 const QMutexLocker lock( &sDiskCacheMutex );
76 return sDiskCache.data( url );
81 const QMutexLocker lock( &sDiskCacheMutex );
82 return sDiskCache.remove( url );
87 const QMutexLocker lock( &sDiskCacheMutex );
88 return sDiskCache.prepare(
metaData );
93 const QMutexLocker lock( &sDiskCacheMutex );
94 sDiskCache.insert( device );
99 const QMutexLocker lock( &sDiskCacheMutex );
100 return sDiskCache.fileMetaData( fileName );
105 const QMutexLocker lock( &sDiskCacheMutex );
106 return sDiskCache.runExpire();
111 const QMutexLocker lock( &sDiskCacheMutex );
112 return sDiskCache.clear();
void setCacheDirectory(const QString &cacheDir)
QIODevice * data(const QUrl &url) override
void updateMetaData(const QNetworkCacheMetaData &metaData) override
QNetworkCacheMetaData metaData(const QUrl &url) override
qint64 maximumCacheSize() const
QNetworkCacheMetaData fileMetaData(const QString &fileName) const
void insert(QIODevice *device) override
QIODevice * prepare(const QNetworkCacheMetaData &metaData) override
bool remove(const QUrl &url) override
void setMaximumCacheSize(qint64 size)
qint64 cacheSize() const override
QString cacheDirectory() const