From c6af3d23c9787d09757e2e92daacd52fb9765075 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sun, 26 Jul 2020 19:41:30 +1200 Subject: [PATCH] Fix --url command line parameter to work with both "=" and " " --- interface/src/Application.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index b7b2fea67d..a5cb1c2936 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3939,12 +3939,15 @@ void Application::handleSandboxStatus(QNetworkReply* reply) { qCDebug(interfaceapp) << "HMD:" << hasHMD << ", Hand Controllers: " << hasHandControllers << ", Using HMD: " << isUsingHMDAndHandControllers; - // when --url in command line, teleport to location - const QString HIFI_URL_COMMAND_LINE_KEY = "--url"; - int urlIndex = arguments().indexOf(HIFI_URL_COMMAND_LINE_KEY); QString addressLookupString; - if (urlIndex != -1) { - QUrl url(arguments().value(urlIndex + 1)); + + // when --url in command line, teleport to location + QCommandLineParser parser; + QCommandLineOption urlOption("url", "", "value"); + parser.addOption(urlOption); + parser.parse(arguments()); + if (parser.isSet(urlOption)) { + QUrl url = QUrl(parser.value(urlOption)); if (url.scheme() == URL_SCHEME_HIFIAPP) { Setting::Handle("startUpApp").set(url.path()); } else {