From 6d1f4ed9420f2c238a2afb9834e189d0651be913 Mon Sep 17 00:00:00 2001 From: Konstantin Date: Fri, 18 Apr 2014 01:13:06 +0200 Subject: [PATCH] Fix format --- interface/src/Application.cpp | 47 +++++++++++++++++------------------ 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index a7a00bf7c7..592370705a 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3555,35 +3555,34 @@ void Application::urlGoTo(int argc, const char * constArgv[]) { //Gets the url (hifi://domain/destination/orientation) QString customUrl = getCmdOption(argc, constArgv, "-url"); - if (customUrl.startsWith("hifi://")) { - QStringList urlParts = customUrl.remove(0, CUSTOM_URL_SCHEME.length() + 2).split('/', QString::SkipEmptyParts); + if (customUrl.startsWith("hifi://")) { + QStringList urlParts = customUrl.remove(0, CUSTOM_URL_SCHEME.length() + 2).split('/', QString::SkipEmptyParts); + if (urlParts.count() > 1) { + // if url has 2 or more parts, the first one is domain name + QString domain = urlParts[0]; - if (urlParts.count() > 1) { - // if url has 2 or more parts, the first one is domain name - QString domain = urlParts[0]; + // second part is either a destination coordinate or + // a place name + QString destination = urlParts[1]; - // second part is either a destination coordinate or - // a place name - QString destination = urlParts[1]; + // any third part is an avatar orientation. + QString orientation = urlParts.count() > 2 ? urlParts[2] : QString(); - // any third part is an avatar orientation. - QString orientation = urlParts.count() > 2 ? urlParts[2] : QString(); - - Menu::goToDomain(domain); + Menu::goToDomain(domain); - // goto either @user, #place, or x-xx,y-yy,z-zz - // style co-ordinate. - Menu::goTo(destination); + // goto either @user, #place, or x-xx,y-yy,z-zz + // style co-ordinate. + Menu::goTo(destination); - if (!orientation.isEmpty()) { - // location orientation - Menu::goToOrientation(orientation); - } - } else if (urlParts.count() == 1) { - // location coordinates or place name - QString destination = urlParts[0]; - Menu::goTo(destination); + if (!orientation.isEmpty()) { + // location orientation + Menu::goToOrientation(orientation); } - + } else if (urlParts.count() == 1) { + // location coordinates or place name + QString destination = urlParts[0]; + Menu::goTo(destination); } + + } }