MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / migrateToExternal

Method migrateToExternal

src/Mod/Material/App/ModelManager.cpp:320–345  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

318
319#if defined(BUILD_MATERIAL_EXTERNAL)
320void ModelManager::migrateToExternal(const std::shared_ptr<Materials::ModelLibrary>& library)
321{
322 try {
323 _externalManager->createLibrary(library->getName(),
324 library->getIcon(),
325 library->isReadOnly());
326 }
327 catch (const CreationError&) {
328 }
329 catch (const ConnectionError&) {
330 }
331
332 auto models = _localManager->libraryModels(library->getName());
333 for (auto& it : *models) {
334 auto uuid = it.getUUID();
335 auto path = it.getPath();
336 auto name = it.getName();
337 Base::Console().log("\t('%s', '%s', '%s')\n",
338 uuid.toStdString().c_str(),
339 path.toStdString().c_str(),
340 name.toStdString().c_str());
341
342 auto model = _localManager->getModel(uuid);
343 _externalManager->migrateModel(library->getName(), path, *model);
344 }
345}
346
347void ModelManager::validateMigration(const std::shared_ptr<Materials::ModelLibrary>& library)
348{

Callers 1

migrateMethod · 0.45

Calls 12

toStdStringMethod · 0.80
createLibraryMethod · 0.45
getNameMethod · 0.45
getIconMethod · 0.45
isReadOnlyMethod · 0.45
libraryModelsMethod · 0.45
getUUIDMethod · 0.45
getPathMethod · 0.45
logMethod · 0.45
c_strMethod · 0.45
getModelMethod · 0.45
migrateModelMethod · 0.45

Tested by

no test coverage detected