Showing the changes to interface/src/Application.cpp (1 of 1 file). Show all
Unified · Split
| @@ -3577,31 +3577,33 @@ void Application::takeSnapshot() { · 3576 unmodified lines | ||
| 3577 | 3577 | void Application::urlGoTo(int argc, const char * constArgv[]) { |
| 3578 | 3578 | //Gets the url (hifi://domain/destination/orientation) |
| 3579 | 3579 | QString customUrl = getCmdOption(argc, constArgv, "-url"); |
| 3580 | − QStringList urlParts = customUrl.remove(0, CUSTOM_URL_SCHEME.length() + 2).split('/', QString::SkipEmptyParts); | |
| 3581 | − if (urlParts.count() == 1) { | |
| 3582 | − // location coordinates or place name | |
| 3583 | − QString domain = urlParts[0]; | |
| 3584 | − Menu::goToDomain(domain); | |
| 3585 | − } else if (urlParts.count() > 1) { | |
| 3586 | − // if url has 2 or more parts, the first one is domain name | |
| 3587 | − QString domain = urlParts[0]; | |
| 3588 | − | |
| 3589 | − // second part is either a destination coordinate or | |
| 3590 | − // a place name | |
| 3591 | − QString destination = urlParts[1]; | |
| 3592 | − | |
| 3593 | − // any third part is an avatar orientation. | |
| 3594 | − QString orientation = urlParts.count() > 2 ? urlParts[2] : QString(); | |
| 3595 | − | |
| 3596 | − Menu::goToDomain(domain); | |
| 3597 | − | |
| 3598 | − // goto either @user, #place, or x-xx,y-yy,z-zz | |
| 3599 | − // style co-ordinate. | |
| 3600 | − Menu::goTo(destination); | |
| 3601 | − | |
| 3602 | − if (!orientation.isEmpty()) { | |
| 3603 | − // location orientation | |
| 3604 | − Menu::goToOrientation(orientation); | |
| 3605 | − } | |
| 3606 | − } | |
| 3580 | + if(customUrl.startsWith(CUSTOM_URL_SCHEME + "//")) { | |
| 3581 | + QStringList urlParts = customUrl.remove(0, CUSTOM_URL_SCHEME.length() + 2).split('/', QString::SkipEmptyParts); | |
| 3582 | + if (urlParts.count() == 1) { | |
| 3583 | + // location coordinates or place name | |
| 3584 | + QString domain = urlParts[0]; | |
| 3585 | + Menu::goToDomain(domain); | |
| 3586 | + } else if (urlParts.count() > 1) { | |
| 3587 | + // if url has 2 or more parts, the first one is domain name | |
| 3588 | + QString domain = urlParts[0]; | |
| 3589 | + | |
| 3590 | + // second part is either a destination coordinate or | |
| 3591 | + // a place name | |
| 3592 | + QString destination = urlParts[1]; | |
| 3593 | + | |
| 3594 | + // any third part is an avatar orientation. | |
| 3595 | + QString orientation = urlParts.count() > 2 ? urlParts[2] : QString(); | |
| 3596 | + | |
| 3597 | + Menu::goToDomain(domain); | |
| 3598 | + | |
| 3599 | + // goto either @user, #place, or x-xx,y-yy,z-zz | |
| 3600 | + // style co-ordinate. | |
| 3601 | + Menu::goTo(destination); | |
| 3602 | + | |
| 3603 | + if (!orientation.isEmpty()) { | |
| 3604 | + // location orientation | |
| 3605 | + Menu::goToOrientation(orientation); | |
| 3606 | + } | |
| 3607 | + } | |
| 3608 | + } | |
| 3607 | 3609 | } |