MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / loadThumbnail

Method loadThumbnail

Telegram/SourceFiles/data/data_document.cpp:858–881  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

856}
857
858void DocumentData::loadThumbnail(Data::FileOrigin origin) {
859 const auto autoLoading = false;
860 const auto finalCheck = [=] {
861 if (const auto active = activeMediaView()) {
862 return !active->thumbnail();
863 }
864 return true;
865 };
866 const auto done = [=](QImage result, QByteArray) {
867 _flags &= ~Flag::PossibleCoverThumbnail;
868 if (const auto active = activeMediaView()) {
869 active->setThumbnail(std::move(result));
870 }
871 };
872 Data::LoadCloudFile(
873 &session(),
874 _thumbnail,
875 origin,
876 LoadFromCloudOrLocal,
877 autoLoading,
878 Data::kImageCacheTag,
879 finalCheck,
880 done);
881}
882
883const ImageLocation &DocumentData::thumbnailLocation() const {
884 return _thumbnail.location;

Callers 15

displayDocumentMethod · 0.45
preloadMethod · 0.45
prepareThumbnailMethod · 0.45
prepareMediaThumbnailMethod · 0.45
paintRowThumbnailMethod · 0.45
PrepareFilePreviewImageFunction · 0.45
loadDocumentThumbnailMethod · 0.45
thumbnailWantedMethod · 0.45
checkStickerSmallMethod · 0.45
ensureMediaCreatedMethod · 0.45
preloadImagesMethod · 0.45

Calls 3

LoadCloudFileFunction · 0.85
thumbnailMethod · 0.45
setThumbnailMethod · 0.45

Tested by

no test coverage detected