mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 11:07:07 +02:00
don't prepend relative paths with hifi scheme
This commit is contained in:
parent
d01b73bdaa
commit
4cef21aa4f
1 changed files with 26 additions and 18 deletions
|
@ -61,25 +61,25 @@ bool AddressManager::handleUrl(const QUrl& lookupUrl) {
|
||||||
// 3. location string (posX,posY,posZ/eulerX,eulerY,eulerZ)
|
// 3. location string (posX,posY,posZ/eulerX,eulerY,eulerZ)
|
||||||
// 4. domain network address (IP or dns resolvable hostname)
|
// 4. domain network address (IP or dns resolvable hostname)
|
||||||
|
|
||||||
if (lookupUrl.isRelative()) {
|
// use our regex'ed helpers to figure out what we're supposed to do with this
|
||||||
// if this is a relative path then handle it as a relative viewpoint
|
if (!handleUsername(lookupUrl.authority())) {
|
||||||
handleRelativeViewpoint(lookupUrl.path());
|
// we're assuming this is either a network address or global place name
|
||||||
} else {
|
// check if it is a network address first
|
||||||
// use our regex'ed helpers to figure out what we're supposed to do with this
|
if (!handleNetworkAddress(lookupUrl.host())) {
|
||||||
if (!handleUsername(lookupUrl.authority())) {
|
// wasn't an address - lookup the place name
|
||||||
// we're assuming this is either a network address or global place name
|
attemptPlaceNameLookup(lookupUrl.host());
|
||||||
// check if it is a network address first
|
|
||||||
if (!handleNetworkAddress(lookupUrl.host())) {
|
|
||||||
// wasn't an address - lookup the place name
|
|
||||||
attemptPlaceNameLookup(lookupUrl.host());
|
|
||||||
}
|
|
||||||
|
|
||||||
// we may have a path that defines a relative viewpoint - if so we should jump to that now
|
|
||||||
handleRelativeViewpoint(lookupUrl.path());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// we may have a path that defines a relative viewpoint - if so we should jump to that now
|
||||||
|
handleRelativeViewpoint(lookupUrl.path());
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
} else if (lookupUrl.toString().startsWith('/')) {
|
||||||
|
qDebug() << "Going to relative path" << lookupUrl.path();
|
||||||
|
|
||||||
|
// if this is a relative path then handle it as a relative viewpoint
|
||||||
|
handleRelativeViewpoint(lookupUrl.path());
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -89,10 +89,18 @@ void AddressManager::handleLookupString(const QString& lookupString) {
|
||||||
if (!lookupString.isEmpty()) {
|
if (!lookupString.isEmpty()) {
|
||||||
// make this a valid hifi URL and handle it off to handleUrl
|
// make this a valid hifi URL and handle it off to handleUrl
|
||||||
QString sanitizedString = lookupString;
|
QString sanitizedString = lookupString;
|
||||||
const QRegExp HIFI_SCHEME_REGEX = QRegExp(HIFI_URL_SCHEME + ":\\/{1,2}", Qt::CaseInsensitive);
|
QUrl lookupURL;
|
||||||
sanitizedString = sanitizedString.remove(HIFI_SCHEME_REGEX);
|
|
||||||
|
|
||||||
handleUrl(QUrl(HIFI_URL_SCHEME + "://" + sanitizedString));
|
if (!lookupString.startsWith('/')) {
|
||||||
|
const QRegExp HIFI_SCHEME_REGEX = QRegExp(HIFI_URL_SCHEME + ":\\/{1,2}", Qt::CaseInsensitive);
|
||||||
|
sanitizedString = sanitizedString.remove(HIFI_SCHEME_REGEX);
|
||||||
|
|
||||||
|
lookupURL = QUrl(HIFI_URL_SCHEME + "://" + sanitizedString);
|
||||||
|
} else {
|
||||||
|
lookupURL = QUrl(lookupString);
|
||||||
|
}
|
||||||
|
|
||||||
|
handleUrl(lookupURL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue