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(); }
55 QString cacheDirectory()
const;
58 void setCacheDirectory(
const QString &cacheDir );
61 qint64 maximumCacheSize()
const;
64 void setMaximumCacheSize( qint64 size );
67 QNetworkCacheMetaData metaData(
const QUrl &url )
override;
70 void updateMetaData(
const QNetworkCacheMetaData &metaData )
override;
73 QIODevice *data(
const QUrl &url )
override;
76 bool remove(
const QUrl &url )
override;
79 qint64 cacheSize()
const override;
82 QIODevice *prepare(
const QNetworkCacheMetaData &metaData )
override;
85 void insert( QIODevice *device )
override;
88 QNetworkCacheMetaData fileMetaData(
const QString &fileName )
const;
92 void clear()
override;
96 qint64 expire()
override;
101 static ExpirableNetworkDiskCache sDiskCache;
102 static QMutex sDiskCacheMutex;
107 #endif // QGSNETWORKDISKCACHE_H network access manager for QGIS
Wrapper implementation of QNetworkDiskCache with all methods guarded by a mutex soly for internal use...