MCPcopy Create free account
hub / github.com/OpenBoard-org/OpenBoard / insert

Method insert

src/core/UBSceneCache.cpp:81–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79
80
81void UBSceneCache::insert (std::shared_ptr<UBDocumentProxy> proxy, int pageIndex, std::shared_ptr<UBGraphicsScene> scene)
82{
83 // remove all entries pointing to this scene
84 const auto keylist = mSceneCache.keys();
85
86 for (const auto& key : keylist)
87 {
88 auto entry = mSceneCache.value(key);
89
90 if (entry->isSceneAvailable() && entry->scene() == scene)
91 {
92 mSceneCache.remove(key);
93 mCachedKeyFIFO.removeAll(key);
94 }
95 }
96
97 UBSceneCacheID key{proxy, pageIndex};
98 insertEntry(key, std::make_shared<SceneCacheEntry>(scene));
99
100 // restore view state
101 if (mViewStates.contains(key))
102 {
103 scene->setViewState(mViewStates.value(key));
104 }
105}
106
107
108bool UBSceneCache::contains(std::shared_ptr<UBDocumentProxy> proxy, int pageIndex) const

Callers 15

OpenLayers.jsFile · 0.45
svg.jsFile · 0.45
UBToolsManagerMethod · 0.45
loadMethod · 0.45
fillLibraryWidgetsMethod · 0.45
parseSvgRectMethod · 0.45
parseSvgEllipseMethod · 0.45
parseSvgPolygonMethod · 0.45
parseSvgPolylineMethod · 0.45
parseSvgTextMethod · 0.45
parseSvgTextareaMethod · 0.45

Calls 6

isSceneAvailableMethod · 0.80
setViewStateMethod · 0.80
valueMethod · 0.45
sceneMethod · 0.45
removeMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected