40 .model = std::make_unique<Model>(this), |
40 .model = std::make_unique<Model>(this), |
41 .id = modelId, |
41 .id = modelId, |
42 .opentype = OpenType::ManuallyOpened, |
42 .opentype = OpenType::ManuallyOpened, |
43 })); |
43 })); |
44 this->makePolygonCacheForModel(modelId); |
44 this->makePolygonCacheForModel(modelId); |
|
45 Q_EMIT this->message(logInfo(tr("New model %1 created").arg(modelId.value))); |
45 return modelId; |
46 return modelId; |
46 } |
47 } |
47 |
48 |
48 Model* DocumentManager::findDependencyByName(const ModelId modelId, const QString& name) |
49 Model* DocumentManager::findDependencyByName(const ModelId modelId, const QString& name) |
49 { |
50 { |
301 removeFromSet(prunable, pair.to); |
303 removeFromSet(prunable, pair.to); |
302 } |
304 } |
303 for (ModelId idToPrune : prunable) { |
305 for (ModelId idToPrune : prunable) { |
304 auto it = this->openModels.find(idToPrune); |
306 auto it = this->openModels.find(idToPrune); |
305 if (it != this->openModels.end()) { |
307 if (it != this->openModels.end()) { |
|
308 Q_EMIT this->message(logInfo(tr("Model %1 (%2) pruned").arg(idToPrune.value).arg(it->second.path))); |
306 this->openModels.erase(it); |
309 this->openModels.erase(it); |
307 } |
310 } |
308 removeFromSet(autoOpened, idToPrune); |
311 removeFromSet(autoOpened, idToPrune); |
309 std::erase_if(dependencyGraph, [&idToPrune](const GraphEdge<ModelId>& edge) { |
312 std::erase_if(dependencyGraph, [&idToPrune](const GraphEdge<ModelId>& edge) { |
310 return edge.from == idToPrune; |
313 return edge.from == idToPrune; |