From ec410d105b524d864f1fc63461e512050a48116c Mon Sep 17 00:00:00 2001 From: Konstantin Date: Sun, 27 Apr 2014 00:31:28 +0200 Subject: [PATCH] Fix CustomUrl Fixed custom url so that hifi://domain/ works. --- interface/src/Menu.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 44117df55c..524e496acc 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -931,7 +931,15 @@ void Menu::goTo() { if (desiredDestination.startsWith(CUSTOM_URL_SCHEME + "//")) { QStringList urlParts = desiredDestination.remove(0, CUSTOM_URL_SCHEME.length() + 2).split('/', QString::SkipEmptyParts); - if (urlParts.count() > 1) { + if (urlParts.count() == 1) { + // location coordinates or place name + QString domain = urlParts[0]; + goToDomain(domain); + // as there are no coordinates, go to 0,0,0 + QString destination = "0,0,0"; + goTo(destination); + } + else if (urlParts.count() > 1) { // if url has 2 or more parts, the first one is domain name QString domain = urlParts[0]; @@ -952,12 +960,7 @@ void Menu::goTo() { // location orientation goToOrientation(orientation); } - } else if (urlParts.count() == 1) { - // location coordinates or place name - QString destination = urlParts[0]; - goTo(destination); } - } else { goToUser(gotoDialog.textValue()); }