| 259 | } |
| 260 | |
| 261 | void LoadingBar::setPercent(float percent) |
| 262 | { |
| 263 | if (percent > 100) |
| 264 | { |
| 265 | percent = 100; |
| 266 | } |
| 267 | if (percent < 0) |
| 268 | { |
| 269 | percent = 0; |
| 270 | } |
| 271 | if (_percent == percent) |
| 272 | { |
| 273 | return; |
| 274 | } |
| 275 | _percent = percent; |
| 276 | |
| 277 | if (_totalLength <= 0) |
| 278 | { |
| 279 | return; |
| 280 | } |
| 281 | |
| 282 | this->updateProgressBar(); |
| 283 | } |
| 284 | |
| 285 | void LoadingBar::updateProgressBar() |
| 286 | { |
no test coverage detected