18 #ifndef QGSNETWORKDISKCACHE_H
19 #define QGSNETWORKDISKCACHE_H
23 #include <QNetworkDiskCache>
26 class QNetworkDiskCache;
30 class ExpirableNetworkDiskCache :
public QNetworkDiskCache
35 explicit ExpirableNetworkDiskCache( QObject *parent =
nullptr ) : QNetworkDiskCache( parent ) {}
36 qint64 runExpire() {
return QNetworkDiskCache::expire(); }
67 QNetworkCacheMetaData
metaData(
const QUrl &url )
override;
73 QIODevice *
data(
const QUrl &url )
override;
76 bool remove(
const QUrl &url )
override;
85 void insert( QIODevice *device )
override;
88 QNetworkCacheMetaData
fileMetaData(
const QString &fileName )
const;
92 void clear()
override;
101 static ExpirableNetworkDiskCache sDiskCache;
102 static QMutex sDiskCacheMutex;
network access manager for QGIS
Wrapper implementation of QNetworkDiskCache with all methods guarded by a mutex soly for internal use...
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