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

Method progress

Telegram/SourceFiles/data/data_photo.cpp:208–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206}
207
208float64 PhotoData::progress() const {
209 if (uploading()) {
210 if (uploadingData->size > 0) {
211 const auto result = float64(uploadingData->offset)
212 / uploadingData->size;
213 return std::clamp(result, 0., 1.);
214 }
215 return 0.;
216 }
217 const auto index = PhotoSizeIndex(PhotoSize::Large);
218 return loading() ? _images[index].loader->currentProgress() : 0.;
219}
220
221bool PhotoData::cancelled() const {
222 const auto index = PhotoSizeIndex(PhotoSize::Large);

Callers 15

PeerPhotoMethod · 0.45
subscribeToUploaderMethod · 0.45
paintButtonLoadingMethod · 0.45
dataProgressMethod · 0.45
dataProgressMethod · 0.45
dataProgressMethod · 0.45
drawMethod · 0.45
drawGroupedMethod · 0.45
dataProgressMethod · 0.45
dataProgressMethod · 0.45

Calls 2

PhotoSizeIndexFunction · 0.85
currentProgressMethod · 0.80

Tested by

no test coverage detected