2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Use empty Storage::Cache::Key as nullopt.

This commit is contained in:
John Preston
2020-05-20 16:28:18 +04:00
parent 581a21dbd9
commit fb322b5fc5
20 changed files with 71 additions and 68 deletions

View File

@@ -1162,7 +1162,7 @@ auto LottieFromDocument(
if (const auto baseKey = document->bigFileBaseCacheKey()) {
return LottieCachedFromContent(
std::forward<Method>(method),
*baseKey,
baseKey,
keyShift,
&document->session(),
Lottie::ReadContent(data, filepath),
@@ -1239,7 +1239,7 @@ bool HasLottieThumbnail(
if (!media->loaded()) {
return false;
}
return document->bigFileBaseCacheKey().has_value();
return document->bigFileBaseCacheKey().valid();
}
return false;
}
@@ -1269,7 +1269,7 @@ std::unique_ptr<Lottie::SinglePlayer> LottieThumbnail(
};
return LottieCachedFromContent(
method,
*baseKey,
baseKey,
uint8(sizeTag),
&document->session(),
content,

View File

@@ -141,7 +141,7 @@ public:
const StorageImageLocation &location() override;
void refreshFileReference(const QByteArray &data) override;
std::optional<Storage::Cache::Key> cacheKey() override;
Storage::Cache::Key cacheKey() override;
void setDelayedStorageLocation(
const StorageImageLocation &location) override;
void performDelayedLoad(Data::FileOrigin origin) override;
@@ -256,8 +256,8 @@ const StorageImageLocation &ImageSource::location() {
void ImageSource::refreshFileReference(const QByteArray &data) {
}
std::optional<Storage::Cache::Key> ImageSource::cacheKey() {
return std::nullopt;
Storage::Cache::Key ImageSource::cacheKey() {
return {};
}
void ImageSource::setDelayedStorageLocation(