QNetworkDiskCache: Fix deprecation warning
access\qnetworkdiskcache.cpp: In member function 'virtual qint64 QNetworkDiskCache::expire()': access\qnetworkdiskcache.cpp:540:44: warning: 'QDateTime QFileInfo::created() const' is deprecated: Use either birthTime() or metadataChangeTime() [-Wdeprecated-declarations] cacheItems.insert(info.created(), path); ^ Change-Id: I5705de5cb4b490ef2bd788fb94ceac0e5b6c0d05 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
parent
1e1de2b2e1
commit
278fa07045
@ -537,7 +537,9 @@ qint64 QNetworkDiskCache::expire()
|
|||||||
QFileInfo info = it.fileInfo();
|
QFileInfo info = it.fileInfo();
|
||||||
QString fileName = info.fileName();
|
QString fileName = info.fileName();
|
||||||
if (fileName.endsWith(CACHE_POSTFIX)) {
|
if (fileName.endsWith(CACHE_POSTFIX)) {
|
||||||
cacheItems.insert(info.created(), path);
|
const QDateTime birthTime = info.fileTime(QFile::FileBirthTime);
|
||||||
|
cacheItems.insert(birthTime.isValid() ? birthTime
|
||||||
|
: info.fileTime(QFile::FileMetadataChangeTime), path);
|
||||||
totalSize += info.size();
|
totalSize += info.size();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user