mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-23 19:01:05 -07:00
Remove cache of material manager
It doesn't make the code much simpler because the cache is also not a local variable. Contributes to issue CURA-6679.
This commit is contained in:
parent
33739ea7a8
commit
be4e754984
4 changed files with 8 additions and 11 deletions
|
|
@ -13,7 +13,6 @@ Item
|
|||
{
|
||||
id: base
|
||||
|
||||
property QtObject materialManager: CuraApplication.getMaterialManager()
|
||||
// Keep PreferencesDialog happy
|
||||
property var resetEnabled: false
|
||||
property var currentItem: null
|
||||
|
|
@ -119,7 +118,7 @@ Item
|
|||
onClicked:
|
||||
{
|
||||
forceActiveFocus();
|
||||
base.newRootMaterialIdToSwitchTo = base.materialManager.createMaterial();
|
||||
base.newRootMaterialIdToSwitchTo = CuraApplication.getMaterialManager().createMaterial();
|
||||
base.toActivateNewMaterial = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -134,7 +133,7 @@ Item
|
|||
onClicked:
|
||||
{
|
||||
forceActiveFocus();
|
||||
base.newRootMaterialIdToSwitchTo = base.materialManager.duplicateMaterial(base.currentItem.container_node);
|
||||
base.newRootMaterialIdToSwitchTo = CuraApplication.getMaterialManager().duplicateMaterial(base.currentItem.container_node);
|
||||
base.toActivateNewMaterial = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -145,7 +144,7 @@ Item
|
|||
id: removeMenuButton
|
||||
text: catalog.i18nc("@action:button", "Remove")
|
||||
iconName: "list-remove"
|
||||
enabled: base.hasCurrentItem && !base.currentItem.is_read_only && !base.isCurrentItemActivated && base.materialManager.canMaterialBeRemoved(base.currentItem.container_node)
|
||||
enabled: base.hasCurrentItem && !base.currentItem.is_read_only && !base.isCurrentItemActivated && CuraApplication.getMaterialManager().canMaterialBeRemoved(base.currentItem.container_node)
|
||||
onClicked:
|
||||
{
|
||||
forceActiveFocus();
|
||||
|
|
@ -294,7 +293,7 @@ Item
|
|||
{
|
||||
// Set the active material as the fallback. It will be selected when the current material is deleted
|
||||
base.newRootMaterialIdToSwitchTo = base.active_root_material_id
|
||||
base.materialManager.removeMaterial(base.currentItem.container_node);
|
||||
CuraApplication.getMaterialManager().removeMaterial(base.currentItem.container_node);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue