Prevent QML errors when model is not yet initialised

I'm not sure when this happens, but it updates this text twice: Once with 'undefined' name and once with the proper name. For the user it displays the name correctly, but it may be so fast that nothing was visible.

Discovered during work on CURA-8686.
This commit is contained in:
Ghostkeeper 2022-01-19 16:31:36 +01:00
parent fa2fbb99c7
commit 9124f213ea
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A

View file

@ -157,7 +157,7 @@ Item
{
id: cloudPrinterNameLabel
leftPadding: UM.Theme.getSize("default_margin").width
text: model.name
text: model.name ? model.name : ""
font: UM.Theme.getFont("large_bold")
color: UM.Theme.getColor("text")
elide: Text.ElideRight