Merge pull request #574 from ctrlaltdavid/fix/url-parameter

Fix --url command line parameter to work with both "=" and " "
This commit is contained in:
kasenvr 2020-07-30 17:18:54 -04:00 committed by GitHub
commit 7a25376131
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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 {