CollectionModel: Add content to fake header for pixmap cache

QNetworkCacheMetaData requires this now.
This commit is contained in:
Jonas Kvinge 2024-05-26 02:49:26 +02:00
parent c655963483
commit 6e90e72b4a
1 changed files with 1 additions and 1 deletions

View File

@ -719,7 +719,7 @@ void CollectionModel::AlbumCoverLoaded(const quint64 id, const AlbumCoverLoaderR
disk_cache_metadata.setSaveToDisk(true);
disk_cache_metadata.setUrl(disk_cache_key);
// Qt 6 now ignores any entry without headers, so add a fake header.
disk_cache_metadata.setRawHeaders(QNetworkCacheMetaData::RawHeaderList() << qMakePair(QByteArray(), QByteArray()));
disk_cache_metadata.setRawHeaders(QNetworkCacheMetaData::RawHeaderList() << qMakePair(QByteArray("collection-thumbnail"), cache_key.toUtf8()));
QIODevice *device_iconcache = sIconCache->prepare(disk_cache_metadata);
if (device_iconcache) {
result.image_scaled.save(device_iconcache, "XPM");