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

Method load

Telegram/SourceFiles/data/data_cloud_file.cpp:99–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99void CloudImage::load(not_null<Main::Session*> session, FileOrigin origin) {
100 const auto autoLoading = false;
101 const auto finalCheck = [=] {
102 if (const auto active = activeView()) {
103 return active->isNull();
104 } else if (_file.flags & CloudFile::Flag::Loaded) {
105 return false;
106 }
107 return !(_file.flags & CloudFile::Flag::Loaded);
108 };
109 const auto done = [=](QImage result, QByteArray) {
110 setToActive(session, std::move(result));
111 };
112 LoadCloudFile(
113 session,
114 _file,
115 origin,
116 LoadFromCloudOrLocal,
117 autoLoading,
118 kImageCacheTag,
119 finalCheck,
120 done);
121}
122
123const ImageLocation &CloudImage::location() const {
124 return _file.location;

Callers

nothing calls this directly

Calls 2

LoadCloudFileFunction · 0.85
isNullMethod · 0.45

Tested by

no test coverage detected