mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 23:23:57 -06:00
Fix QML null warnings
This commit is contained in:
parent
958f1a855c
commit
15f4d1231b
2 changed files with 24 additions and 8 deletions
|
@ -16,6 +16,10 @@ Button
|
|||
|
||||
property bool isValidMaterial:
|
||||
{
|
||||
if (configuration === null)
|
||||
{
|
||||
return false
|
||||
}
|
||||
var extruderConfigurations = configuration.extruderConfigurations
|
||||
|
||||
for (var index in extruderConfigurations)
|
||||
|
@ -62,11 +66,11 @@ Button
|
|||
Repeater
|
||||
{
|
||||
id: repeater
|
||||
model: configuration.extruderConfigurations
|
||||
model: configuration !== null ? configuration.extruderConfigurations: null
|
||||
width: parent.width
|
||||
delegate: PrintCoreConfiguration
|
||||
{
|
||||
width: Math.round(parent.width / configuration.extruderConfigurations.length)
|
||||
width: Math.round(parent.width / (configuration !== null ? configuration.extruderConfigurations.length : 1))
|
||||
printCoreConfiguration: modelData
|
||||
visible: configurationItem.isValidMaterial
|
||||
}
|
||||
|
@ -100,6 +104,11 @@ Button
|
|||
id: unknownMaterialMessage
|
||||
text:
|
||||
{
|
||||
if (configuration === null)
|
||||
{
|
||||
return ""
|
||||
}
|
||||
|
||||
var extruderConfigurations = configuration.extruderConfigurations
|
||||
var unknownMaterials = []
|
||||
for (var index in extruderConfigurations)
|
||||
|
@ -194,7 +203,14 @@ Button
|
|||
{
|
||||
id: buildplateLabel
|
||||
source: UM.Theme.getIcon("buildplate")
|
||||
text: configuration.buildplateConfiguration.charAt(0).toUpperCase() + configuration.buildplateConfiguration.substr(1)
|
||||
text:
|
||||
{
|
||||
if (configuration === null)
|
||||
{
|
||||
return ""
|
||||
}
|
||||
return configuration.buildplateConfiguration.charAt(0).toUpperCase() + configuration.buildplateConfiguration.substr(1)
|
||||
}
|
||||
anchors.left: parent.left
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue