Fix --url command line parameter to work with both "=" and " "

This commit is contained in:
David Rowe 2020-07-26 19:41:30 +12:00
parent bfb4eaeb21
commit c6af3d23c9

View file

@ -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<QVariant>("startUpApp").set(url.path());
} else {