| 319 | } |
| 320 | |
| 321 | void UBSceneCache::SceneCacheEntry::startLoading() |
| 322 | { |
| 323 | mTimer = new QTimer; |
| 324 | QObject::connect(mTimer, &QTimer::timeout, mTimer, [this](){ |
| 325 | if (UBApplication::isClosing) |
| 326 | { |
| 327 | mTimer->stop(); |
| 328 | delete mTimer; |
| 329 | return; |
| 330 | } |
| 331 | |
| 332 | if (mContext) |
| 333 | { |
| 334 | mContext->step(); |
| 335 | |
| 336 | if (mContext->isFinished()) |
| 337 | { |
| 338 | mScene = mContext->scene(); |
| 339 | mContext = nullptr; |
| 340 | mTimer->stop(); |
| 341 | delete mTimer; |
| 342 | mTimer = nullptr; |
| 343 | } |
| 344 | } |
| 345 | }); |
| 346 | |
| 347 | mTimer->start(); |
| 348 | } |
| 349 | |
| 350 | bool UBSceneCache::SceneCacheEntry::isSceneAvailable() const |
| 351 | { |
no test coverage detected