History

Merge branch 'master' of https://github.com/highfidelity/hifi into 19561

Thijs Wenker committed 12 years ago

Commit 14e9cb72 parents d93f91a 8a823ee8 files · +252 −190Browse files

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

Unified · Split

interface/src/Application.cpp+15−15
@@ -316,6 +316,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 315 unmodified lines
316316 Particle::setVoxelEditPacketSender(&_voxelEditSender);
317317 Particle::setParticleEditPacketSender(&_particleEditSender);
318318
319+ // when -url in command line, teleport to location
320+ urlGoTo(argc, constArgv);
321+
319322 // For now we're going to set the PPS for outbound packets to be super high, this is
320323 // probably not the right long term solution. But for now, we're going to do this to
321324 // allow you to move a particle around in your hand
@@ -352,8 +355,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 30 unmodified lines
352355 QMutexLocker locker(&_settingsMutex);
353356 _previousScriptLocation = _settings->value("LastScriptLocation", QVariant("")).toString();
354357 }
355− //When -url in command line, teleport to location
356− urlGoTo(argc, constArgv);
357358 }
358359
359360 Application::~Application() {
@@ -3583,34 +3584,33 @@ void Application::takeSnapshot() { · 3223 unmodified lines
35833584 void Application::urlGoTo(int argc, const char * constArgv[]) {
35843585 //Gets the url (hifi://domain/destination/orientation)
35853586 QString customUrl = getCmdOption(argc, constArgv, "-url");
3586−
3587− if (customUrl.startsWith("hifi://")) {
3587+ if(customUrl.startsWith(CUSTOM_URL_SCHEME + "//")) {
35883588 QStringList urlParts = customUrl.remove(0, CUSTOM_URL_SCHEME.length() + 2).split('/', QString::SkipEmptyParts);
3589− if (urlParts.count() > 1) {
3589+ if (urlParts.count() == 1) {
3590+ // location coordinates or place name
3591+ QString domain = urlParts[0];
3592+ Menu::goToDomain(domain);
3593+ } else if (urlParts.count() > 1) {
35903594 // if url has 2 or more parts, the first one is domain name
35913595 QString domain = urlParts[0];
3592−
3596+
35933597 // second part is either a destination coordinate or
35943598 // a place name
35953599 QString destination = urlParts[1];
3596−
3600+
35973601 // any third part is an avatar orientation.
35983602 QString orientation = urlParts.count() > 2 ? urlParts[2] : QString();
3599−
3603+
36003604 Menu::goToDomain(domain);
3601−
3605+
36023606 // goto either @user, #place, or x-xx,y-yy,z-zz
36033607 // style co-ordinate.
36043608 Menu::goTo(destination);
3605−
3609+
36063610 if (!orientation.isEmpty()) {
36073611 // location orientation
36083612 Menu::goToOrientation(orientation);
36093613 }
3610− } else if (urlParts.count() == 1) {
3611− // location coordinates or place name
3612− QString destination = urlParts[0];
3613− Menu::goTo(destination);
3614− }
3614+ }
36153615 }
36163616 }

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