History

Re-add customUrl.startWith

Konstantin committed 12 years ago

Commit 65706ae1 parent 14b91aa1 file · +29 −27Browse files

Showing the changes to interface/src/Application.cpp (1 of 1 file). Show all

Unified · Split

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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t