2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Start DocumentData::thumbnail move to DocumentMedia.

This commit is contained in:
John Preston
2020-04-15 18:06:34 +04:00
parent 1329870c8e
commit 956c3af0ae
37 changed files with 511 additions and 312 deletions

View File

@@ -118,12 +118,8 @@ DocumentData *WallPaper::document() const {
return _document;
}
Image *WallPaper::thumbnail() const {
return _thumbnail
? _thumbnail.get()
: _document
? _document->thumbnail()
: nullptr;
Image *WallPaper::localThumbnail() const {
return _thumbnail.get();
}
bool WallPaper::isPattern() const {
@@ -143,7 +139,7 @@ bool WallPaper::isDark() const {
}
bool WallPaper::isLocal() const {
return !document() && thumbnail();
return !document() && _thumbnail;
}
bool WallPaper::isBlurred() const {
@@ -187,10 +183,13 @@ QString WallPaper::shareUrl() const {
: base + '?' + params.join('&');
}
void WallPaper::loadThumbnail() const {
void WallPaper::loadLocalThumbnail() const {
if (_thumbnail) {
_thumbnail->load(fileOrigin());
}
}
void WallPaper::loadDocumentThumbnail() const {
if (_document) {
_document->loadThumbnail(fileOrigin());
}