| 261 | } |
| 262 | |
| 263 | void MaterialLibraryLocal::updatePaths(const QString& oldPath, const QString& newPath) |
| 264 | { |
| 265 | // Update the path map |
| 266 | QString op = getRelativePath(oldPath); |
| 267 | QString np = getRelativePath(newPath); |
| 268 | std::unique_ptr<std::map<QString, std::shared_ptr<Material>>> pathMap = |
| 269 | std::make_unique<std::map<QString, std::shared_ptr<Material>>>(); |
| 270 | for (auto& itp : *_materialPathMap) { |
| 271 | QString path = itp.first; |
| 272 | if (path.startsWith(op)) { |
| 273 | path = np + path.remove(0, op.size()); |
| 274 | } |
| 275 | itp.second->setDirectory(path); |
| 276 | (*pathMap)[path] = itp.second; |
| 277 | } |
| 278 | |
| 279 | _materialPathMap = std::move(pathMap); |
| 280 | } |
| 281 | |
| 282 | std::shared_ptr<Material> |
| 283 | MaterialLibraryLocal::saveMaterial(const std::shared_ptr<Material>& material, |
nothing calls this directly
no test coverage detected