mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 23:23:57 -06:00
Fix Toolbox QML null object warnings
CURA-5670
This commit is contained in:
parent
5a36bc963c
commit
d6046c725a
6 changed files with 19 additions and 7 deletions
|
@ -32,7 +32,7 @@ Item
|
|||
width: UM.Theme.getSize("toolbox_thumbnail_medium").width
|
||||
height: UM.Theme.getSize("toolbox_thumbnail_medium").height
|
||||
fillMode: Image.PreserveAspectFit
|
||||
source: details.icon_url || "../images/logobot.svg"
|
||||
source: details === null ? "" : (details.icon_url || "../images/logobot.svg")
|
||||
mipmap: true
|
||||
anchors
|
||||
{
|
||||
|
@ -55,7 +55,7 @@ Item
|
|||
rightMargin: UM.Theme.getSize("wide_margin").width
|
||||
bottomMargin: UM.Theme.getSize("default_margin").height
|
||||
}
|
||||
text: details.name || ""
|
||||
text: details === null ? "" : (details.name || "")
|
||||
font: UM.Theme.getFont("large")
|
||||
color: UM.Theme.getColor("text")
|
||||
wrapMode: Text.WordWrap
|
||||
|
@ -114,7 +114,7 @@ Item
|
|||
height: childrenRect.height
|
||||
Label
|
||||
{
|
||||
text: details.version || catalog.i18nc("@label", "Unknown")
|
||||
text: details === null ? "" : (details.version || catalog.i18nc("@label", "Unknown"))
|
||||
font: UM.Theme.getFont("very_small")
|
||||
color: UM.Theme.getColor("text")
|
||||
}
|
||||
|
@ -122,6 +122,10 @@ Item
|
|||
{
|
||||
text:
|
||||
{
|
||||
if (details === null)
|
||||
{
|
||||
return ""
|
||||
}
|
||||
var date = new Date(details.last_updated)
|
||||
return date.toLocaleString(UM.Preferences.getValue("general/language"))
|
||||
}
|
||||
|
@ -132,6 +136,10 @@ Item
|
|||
{
|
||||
text:
|
||||
{
|
||||
if (details === null)
|
||||
{
|
||||
return ""
|
||||
}
|
||||
if (details.author_email)
|
||||
{
|
||||
return "<a href=\"mailto:" + details.author_email+"?Subject=Cura: " + details.name + "\">" + details.author_name + "</a>"
|
||||
|
@ -148,7 +156,7 @@ Item
|
|||
}
|
||||
Label
|
||||
{
|
||||
text: details.download_count || catalog.i18nc("@label", "Unknown")
|
||||
text: details === null ? "" : (details.download_count || catalog.i18nc("@label", "Unknown"))
|
||||
font: UM.Theme.getFont("very_small")
|
||||
color: UM.Theme.getColor("text")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue