Commit 8dbb35db authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[User Switcher] Fix fallback user picture

As far as the JavaScript environment is concerned when comparing a QUrl (url basic type) is an empty Object.
This meant that an expression of !!url always evaluates true, even if the URL is empty/invalid.
Explicitly convert it toString() to make comparisons work.
parent 0550d53e
......@@ -56,7 +56,7 @@ Item {
property: "icon"
value: kuser.faceIconUrl
// revert to the plasmoid icon if no face given
when: !!kuser.faceIconUrl
when: kuser.faceIconUrl.toString() !== ""
}
KCoreAddons.KUser {
......@@ -90,7 +90,7 @@ Item {
width: height
height: compactRoot.height
Layout.preferredWidth: height
source: visible ? (kuser.faceIconUrl || "user-identity") : ""
source: visible ? (kuser.faceIconUrl.toString() || "user-identity") : ""
visible: root.showFace
}
......@@ -163,7 +163,7 @@ Item {
id: currentUserItem
text: root.displayedName
subText: i18n("Current user")
icon: kuser.faceIconUrl || "user-identity"
icon: kuser.faceIconUrl.toString() || "user-identity"
interactive: false
interactiveIcon: true
onIconClicked: KCMShell.open("user_manager")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment