mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 13:18:38 +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>
|
||||||
|
|
||||||
<div class="property">
|
<div class="property">
|
||||||
<div class="label">Href</div>
|
<div class="label">Href - Hifi://address</div>
|
||||||
<div class="value">
|
<div class="value">
|
||||||
<input id="property-hyperlink-href" class="url">
|
<input id="property-hyperlink-href" class="url">
|
||||||
</div>
|
</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) {
|
void EntityItem::simulate(const quint64& now) {
|
||||||
if (_lastSimulated == 0) {
|
if (_lastSimulated == 0) {
|
||||||
_lastSimulated = now;
|
_lastSimulated = now;
|
||||||
|
|
|
@ -172,7 +172,7 @@ public:
|
||||||
|
|
||||||
// Hyperlink related getters and setters
|
// Hyperlink related getters and setters
|
||||||
QString getHref() const { return _href; }
|
QString getHref() const { return _href; }
|
||||||
void setHref(QString value) { _href = value; }
|
void setHref(QString value);
|
||||||
|
|
||||||
QString getDescription() const { return _description; }
|
QString getDescription() const { return _description; }
|
||||||
void setDescription(QString value) { _description = value; }
|
void setDescription(QString value) { _description = value; }
|
||||||
|
|
Loading…
Reference in a new issue