mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
Merge pull request #16168 from zfox23/DEV-555
DEV-555: Ensure 'href' entity property supports relative paths (coordinates and named paths)
This commit is contained in:
commit
a324f8b4cd
1 changed files with 7 additions and 10 deletions
|
@ -1075,16 +1075,13 @@ void EntityItem::setMass(float mass) {
|
||||||
|
|
||||||
void EntityItem::setHref(QString value) {
|
void EntityItem::setHref(QString value) {
|
||||||
auto href = value.toLower();
|
auto href = value.toLower();
|
||||||
|
// Let's let the user set the value of this property to anything, then let consumers of the property
|
||||||
// If the string has something and doesn't start with with "hifi://" it shouldn't be set
|
// decide what to do with it. Currently, the only in-engine consumers are `EntityTreeRenderer::mousePressEvent()`
|
||||||
// We allow the string to be empty, because that's the initial state of this property
|
// and `OtherAvatar::handleChangedAvatarEntityData()` (to remove the href property from others' avatar entities).
|
||||||
if (!value.isEmpty() &&
|
//
|
||||||
!(value.toLower().startsWith("hifi://")) &&
|
// We want this property to be as flexible as possible. The value of this property _should_ only be values that can
|
||||||
!(value.toLower().startsWith("file://"))
|
// be handled by `AddressManager::handleLookupString()`. That function will return `false` and not do
|
||||||
// TODO: serverless-domains will eventually support http and https also
|
// anything if the value of this property isn't something that function can handle.
|
||||||
) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
_href = value;
|
_href = value;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue