mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 14:03:55 +02:00
extract avatar name from url if empty
This commit is contained in:
parent
c765730c5a
commit
bad7890c83
1 changed files with 16 additions and 1 deletions
|
@ -32,6 +32,21 @@ Rectangle {
|
|||
property var jointNames;
|
||||
property var currentAvatarSettings;
|
||||
|
||||
function getAvatarName() {
|
||||
if(avatarName !== '') {
|
||||
return avatarName;
|
||||
}
|
||||
|
||||
if(currentAvatar === null) {
|
||||
return '';
|
||||
}
|
||||
|
||||
var avatarUrl = currentAvatar.entry.avatarUrl;
|
||||
var splitted = avatarUrl.split('/');
|
||||
|
||||
return splitted[splitted.length - 1];
|
||||
}
|
||||
|
||||
property string avatarName: currentAvatar ? currentAvatar.name : ''
|
||||
property string avatarUrl: currentAvatar ? currentAvatar.thumbnailUrl : null
|
||||
property bool isAvatarInFavorites: currentAvatar ? allAvatars.findAvatar(currentAvatar.name) !== undefined : false
|
||||
|
@ -353,7 +368,7 @@ Rectangle {
|
|||
|
||||
TextStyle3 {
|
||||
id: avatarNameLabel
|
||||
text: avatarName
|
||||
text: getAvatarName()
|
||||
anchors.left: avatarImage.right
|
||||
anchors.leftMargin: 30
|
||||
anchors.top: star.bottom
|
||||
|
|
Loading…
Reference in a new issue