| 62 | } |
| 63 | |
| 64 | std::shared_ptr<UBGraphicsScene> UBSceneCache::prepareLoading(std::shared_ptr<UBDocumentProxy> proxy, int pageIndex) |
| 65 | { |
| 66 | if (mSceneCache.contains({proxy, pageIndex})) |
| 67 | { |
| 68 | return value(proxy, pageIndex); |
| 69 | } |
| 70 | |
| 71 | // no entry in cache; create a cache entry to load scene |
| 72 | qDebug() << "Preparing to load scene" << pageIndex; |
| 73 | auto cacheEntry = std::make_shared<SceneCacheEntry>(proxy, pageIndex); |
| 74 | |
| 75 | insertEntry({proxy, pageIndex}, cacheEntry); |
| 76 | cacheEntry->startLoading(); |
| 77 | return nullptr; |
| 78 | } |
| 79 | |
| 80 | |
| 81 | void UBSceneCache::insert (std::shared_ptr<UBDocumentProxy> proxy, int pageIndex, std::shared_ptr<UBGraphicsScene> scene) |
no test coverage detected