2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Set correct cache tags for different file types.

This commit is contained in:
John Preston
2018-08-29 00:09:55 +03:00
parent e2f08d4161
commit 55f60866cb
9 changed files with 119 additions and 31 deletions

View File

@@ -1024,7 +1024,9 @@ void RemoteImage::setImageBytes(
if (!location.isNull() && !bytes.isEmpty()) {
Auth().data().cache().putIfEmpty(
Data::StorageCacheKey(location),
base::duplicate(bytes));
Storage::Cache::Database::TaggedValue(
base::duplicate(bytes),
Data::kImageCacheTag));
}
}
@@ -1165,7 +1167,8 @@ FileLoader *StorageImage::createLoader(
origin,
_size,
fromCloud,
autoLoading);
autoLoading,
Data::kImageCacheTag);
}
WebFileImage::WebFileImage(
@@ -1220,7 +1223,8 @@ FileLoader *WebFileImage::createLoader(
&_location,
_size,
fromCloud,
autoLoading);
autoLoading,
Data::kImageCacheTag);
}
DelayedStorageImage::DelayedStorageImage() : StorageImage(StorageImageLocation())
@@ -1359,7 +1363,12 @@ FileLoader *WebImage::createLoader(
Data::FileOrigin origin,
LoadFromCloudSetting fromCloud,
bool autoLoading) {
return new webFileLoader(_url, QString(), fromCloud, autoLoading);
return new webFileLoader(
_url,
QString(),
fromCloud,
autoLoading,
Data::kImageCacheTag);
}
namespace internal {