| 97 | } |
| 98 | |
| 99 | void 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 | |
| 123 | const ImageLocation &CloudImage::location() const { |
| 124 | return _file.location; |
nothing calls this directly
no test coverage detected