Skip to content
Snippets Groups Projects
Commit bc5dad22 authored by Matthias Puchner's avatar Matthias Puchner
Browse files

simplify material copying

parent 65a9fdf1
No related branches found
No related tags found
1 merge request!494Remove SessionModel/SessionItem from MaterialModel/MaterialItem
Pipeline #51057 failed
......@@ -131,11 +131,8 @@ void GUI::Model::JobFunctions::setupJobItemSampleData(JobItem* jobItem,
// copy used materials into material container
for (auto* itemWithMaterial : sampleItem->itemsWithMaterial()) {
auto* material = itemWithMaterial->materialItem();
if (!jobItem->materialItems().findMaterialItem(material->identifier())) {
auto* materialCopy = jobItem->materialItems().insertCopy(*material);
materialCopy->setIdentifier(material->identifier()); // insertCopy() doesn't do this
materialCopy->setMaterialName(material->materialName()); // insertCopy() doesn't do this
}
if (!jobItem->materialItems().findMaterialItem(material->identifier()))
jobItem->materialItems().addMaterial(new MaterialItem(*material));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment