Prevent infinite recursion in material page if it could not be found

This commit is contained in:
Jaime van Kessel 2019-10-08 16:49:54 +02:00
parent 987ccd28ba
commit cadc145008
No known key found for this signature in database
GPG Key ID: 3710727397403C91
2 changed files with 8 additions and 5 deletions

View File

@ -59,11 +59,14 @@ Item
onCurrentItemChanged: onCurrentItemChanged:
{ {
forceActiveFocus() forceActiveFocus()
materialDetailsPanel.currentItem = currentItem if(materialDetailsPanel.currentItem != currentItem)
// CURA-6679 If the current item is gone after the model update, reset the current item to the active material.
if (currentItem == null)
{ {
resetExpandedActiveMaterial() materialDetailsPanel.currentItem = currentItem
// CURA-6679 If the current item is gone after the model update, reset the current item to the active material.
if (currentItem == null)
{
resetExpandedActiveMaterial()
}
} }
} }

View File

@ -17,7 +17,7 @@ TabView
property QtObject properties property QtObject properties
property var currentMaterialNode: null property var currentMaterialNode: null
property bool editingEnabled: false; property bool editingEnabled: false
property string currency: UM.Preferences.getValue("cura/currency") ? UM.Preferences.getValue("cura/currency") : "€" property string currency: UM.Preferences.getValue("cura/currency") ? UM.Preferences.getValue("cura/currency") : "€"
property real firstColumnWidth: (width * 0.50) | 0 property real firstColumnWidth: (width * 0.50) | 0
property real secondColumnWidth: (width * 0.40) | 0 property real secondColumnWidth: (width * 0.40) | 0