| 206 | } |
| 207 | |
| 208 | float64 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 | |
| 221 | bool PhotoData::cancelled() const { |
| 222 | const auto index = PhotoSizeIndex(PhotoSize::Large); |
no test coverage detected