From 9124f213ea074711755f8a6aa49281a63eab9a91 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 19 Jan 2022 16:31:36 +0100 Subject: [PATCH] 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. --- resources/qml/WelcomePages/AddCloudPrintersView.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/WelcomePages/AddCloudPrintersView.qml b/resources/qml/WelcomePages/AddCloudPrintersView.qml index f454dc139d..0b94d21fae 100644 --- a/resources/qml/WelcomePages/AddCloudPrintersView.qml +++ b/resources/qml/WelcomePages/AddCloudPrintersView.qml @@ -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