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

'base::optional_variant<' -> 'std::variant<v::null_t,'

This commit is contained in:
John Preston
2020-08-31 13:04:17 +04:00
parent 734d834a20
commit f0e1d2fd02
38 changed files with 189 additions and 169 deletions

View File

@@ -489,7 +489,7 @@ void EditCaptionBox::updateEditPreview() {
auto isGif = false;
auto shouldAsDoc = true;
auto docPhotoSize = QSize();
if (const auto image = base::get_if<Info::Image>(fileMedia)) {
if (const auto image = std::get_if<Info::Image>(fileMedia)) {
shouldAsDoc = !Storage::ValidateThumbDimensions(
image->data.width(),
image->data.height());
@@ -501,14 +501,14 @@ void EditCaptionBox::updateEditPreview() {
_animated = isGif;
_photo = !isGif && !shouldAsDoc;
_isImage = true;
} else if (const auto video = base::get_if<Info::Video>(fileMedia)) {
} else if (const auto video = std::get_if<Info::Video>(fileMedia)) {
isGif = video->isGifv;
_animated = true;
shouldAsDoc = false;
}
if (shouldAsDoc) {
auto nameString = filename;
if (const auto song = base::get_if<Info::Song>(fileMedia)) {
if (const auto song = std::get_if<Info::Song>(fileMedia)) {
nameString = DocumentData::ComposeNameString(
filename,
song->title,
@@ -684,7 +684,7 @@ bool EditCaptionBox::fileFromClipboard(not_null<const QMimeData*> data) {
const auto imageAsDoc = [&] {
using Info = FileMediaInformation;
const auto fileMedia = &file->information->media;
if (const auto image = base::get_if<Info::Image>(fileMedia)) {
if (const auto image = std::get_if<Info::Image>(fileMedia)) {
return !Storage::ValidateThumbDimensions(
image->data.width(),
image->data.height());