| 1039 | } |
| 1040 | |
| 1041 | void DocumentData::finishLoad() { |
| 1042 | // NB! _loader may be in ~FileLoader() already. |
| 1043 | const auto guard = gsl::finally([&] { |
| 1044 | destroyLoader(); |
| 1045 | }); |
| 1046 | if (!_loader || _loader->cancelled()) { |
| 1047 | _flags |= Flag::DownloadCancelled; |
| 1048 | return; |
| 1049 | } |
| 1050 | setLocation(Core::FileLocation(_loader->fileName())); |
| 1051 | setGoodThumbnailDataReady(); |
| 1052 | if (const auto media = activeMediaView()) { |
| 1053 | media->setBytes(_loader->bytes()); |
| 1054 | media->checkStickerLarge(_loader.get()); |
| 1055 | } |
| 1056 | } |
| 1057 | |
| 1058 | void DocumentData::destroyLoader() { |
| 1059 | if (!_loader) { |
nothing calls this directly
no test coverage detected