2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 22:55:11 +00:00

Move to std::optional.

This commit is contained in:
John Preston
2018-09-21 19:28:46 +03:00
parent 850efbde95
commit 2e5a0e056c
115 changed files with 632 additions and 672 deletions

View File

@@ -917,8 +917,8 @@ void Image::restore() const {
_forgot = false;
}
base::optional<Storage::Cache::Key> Image::cacheKey() const {
return base::none;
std::optional<Storage::Cache::Key> Image::cacheKey() const {
return std::nullopt;
}
void Image::invalidateSizeCache() const {
@@ -995,7 +995,7 @@ void RemoteImage::destroyLoaderDelayed(FileLoader *newValue) const {
void RemoteImage::loadLocal() {
if (loaded() || amLoading()) return;
_loader = createLoader(base::none, LoadFromLocalOnly, true);
_loader = createLoader(std::nullopt, LoadFromLocalOnly, true);
if (_loader) _loader->start();
}
@@ -1138,9 +1138,9 @@ StorageImage::StorageImage(
setImageBytes(bytes);
}
base::optional<Storage::Cache::Key> StorageImage::cacheKey() const {
std::optional<Storage::Cache::Key> StorageImage::cacheKey() const {
return _location.isNull()
? base::none
? std::nullopt
: base::make_optional(Data::StorageCacheKey(_location));
}
@@ -1195,9 +1195,9 @@ WebFileImage::WebFileImage(
, _size(size) {
}
base::optional<Storage::Cache::Key> WebFileImage::cacheKey() const {
std::optional<Storage::Cache::Key> WebFileImage::cacheKey() const {
return _location.isNull()
? base::none
? std::nullopt
: base::make_optional(Data::WebDocumentCacheKey(_location));
}
@@ -1339,7 +1339,7 @@ WebImage::WebImage(const QString &url, int width, int height)
, _height(height) {
}
base::optional<Storage::Cache::Key> WebImage::cacheKey() const {
std::optional<Storage::Cache::Key> WebImage::cacheKey() const {
return Data::UrlCacheKey(_url);
}