mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 10:52:56 +00:00
update cache size when remove invalid cache file from QNetworkDiskCache::data()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
14a1636841
commit
56917eaafa
1 changed files with 2 additions and 1 deletions
|
@ -365,6 +365,7 @@ QNetworkCacheMetaData QNetworkDiskCache::fileMetaData(const QString &fileName) c
|
||||||
}
|
}
|
||||||
QCacheItem cacheitem;
|
QCacheItem cacheitem;
|
||||||
if (!cacheitem.read(&file)) {
|
if (!cacheitem.read(&file)) {
|
||||||
|
// ### this will not update cache size
|
||||||
QFile::remove(fileName);
|
QFile::remove(fileName);
|
||||||
return QNetworkCacheMetaData();
|
return QNetworkCacheMetaData();
|
||||||
}
|
}
|
||||||
|
@ -397,7 +398,7 @@ QIODevice *QNetworkDiskCache::data(const QUrl &url)
|
||||||
#if defined(QNETWORKDISKCACHE_DEBUG)
|
#if defined(QNETWORKDISKCACHE_DEBUG)
|
||||||
qDebug() << "QNetworkDiskCache::data: could not read cache" << fileName;
|
qDebug() << "QNetworkDiskCache::data: could not read cache" << fileName;
|
||||||
#endif
|
#endif
|
||||||
file.remove();
|
remove(url);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue