mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 12:04:18 +02:00
Merge pull request #6964 from ericrius1/editHref
Validate href entity property (hifi:// only)
This commit is contained in:
commit
33226796ff
3 changed files with 10 additions and 2 deletions
|
@ -982,7 +982,7 @@
|
|||
</div>
|
||||
|
||||
<div class="property">
|
||||
<div class="label">Href</div>
|
||||
<div class="label">Href - Hifi://address</div>
|
||||
<div class="value">
|
||||
<input id="property-hyperlink-href" class="url">
|
||||
</div>
|
||||
|
|
|
@ -812,6 +812,14 @@ void EntityItem::setMass(float mass) {
|
|||
}
|
||||
}
|
||||
|
||||
void EntityItem::setHref(QString value) {
|
||||
auto href = value.toLower();
|
||||
if (! (value.toLower().startsWith("hifi://")) ) {
|
||||
return;
|
||||
}
|
||||
_href = value;
|
||||
}
|
||||
|
||||
void EntityItem::simulate(const quint64& now) {
|
||||
if (_lastSimulated == 0) {
|
||||
_lastSimulated = now;
|
||||
|
|
|
@ -172,7 +172,7 @@ public:
|
|||
|
||||
// Hyperlink related getters and setters
|
||||
QString getHref() const { return _href; }
|
||||
void setHref(QString value) { _href = value; }
|
||||
void setHref(QString value);
|
||||
|
||||
QString getDescription() const { return _description; }
|
||||
void setDescription(QString value) { _description = value; }
|
||||
|
|
Loading…
Reference in a new issue