mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 04:24:47 +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 jointNames;
|
||||||
property var currentAvatarSettings;
|
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 avatarName: currentAvatar ? currentAvatar.name : ''
|
||||||
property string avatarUrl: currentAvatar ? currentAvatar.thumbnailUrl : null
|
property string avatarUrl: currentAvatar ? currentAvatar.thumbnailUrl : null
|
||||||
property bool isAvatarInFavorites: currentAvatar ? allAvatars.findAvatar(currentAvatar.name) !== undefined : false
|
property bool isAvatarInFavorites: currentAvatar ? allAvatars.findAvatar(currentAvatar.name) !== undefined : false
|
||||||
|
@ -353,7 +368,7 @@ Rectangle {
|
||||||
|
|
||||||
TextStyle3 {
|
TextStyle3 {
|
||||||
id: avatarNameLabel
|
id: avatarNameLabel
|
||||||
text: avatarName
|
text: getAvatarName()
|
||||||
anchors.left: avatarImage.right
|
anchors.left: avatarImage.right
|
||||||
anchors.leftMargin: 30
|
anchors.leftMargin: 30
|
||||||
anchors.top: star.bottom
|
anchors.top: star.bottom
|
||||||
|
|
Loading…
Reference in a new issue