2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 22:55:11 +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

@@ -766,11 +766,11 @@ SingleMediaPreview *SingleMediaPreview::Create(
auto preview = QImage();
bool animated = false;
bool animationPreview = false;
if (const auto image = base::get_if<FileMediaInformation::Image>(
if (const auto image = std::get_if<FileMediaInformation::Image>(
&file.information->media)) {
preview = image->data;
animated = animationPreview = image->animated;
} else if (const auto video = base::get_if<FileMediaInformation::Video>(
} else if (const auto video = std::get_if<FileMediaInformation::Video>(
&file.information->media)) {
preview = video->thumbnail;
animated = true;
@@ -1004,10 +1004,10 @@ void SingleFilePreview::prepareThumb(const QImage &preview) {
void SingleFilePreview::preparePreview(const Storage::PreparedFile &file) {
auto preview = QImage();
if (const auto image = base::get_if<FileMediaInformation::Image>(
if (const auto image = std::get_if<FileMediaInformation::Image>(
&file.information->media)) {
preview = image->data;
} else if (const auto video = base::get_if<FileMediaInformation::Video>(
} else if (const auto video = std::get_if<FileMediaInformation::Video>(
&file.information->media)) {
preview = video->thumbnail;
}
@@ -1034,7 +1034,7 @@ void SingleFilePreview::preparePreview(const Storage::PreparedFile &file) {
auto songTitle = QString();
auto songPerformer = QString();
if (file.information) {
if (const auto song = base::get_if<FileMediaInformation::Song>(
if (const auto song = std::get_if<FileMediaInformation::Song>(
&file.information->media)) {
songTitle = song->title;
songPerformer = song->performer;