Make --url take existing Interface to FILE, HTTP, and HTTPS serverless

This commit is contained in:
David Rowe 2020-02-06 11:11:41 +13:00
parent fa30866701
commit ad427e31a7
2 changed files with 4 additions and 2 deletions

View file

@ -9263,7 +9263,7 @@ void Application::readArgumentsFromLocalSocket() const {
// If we received a message, try to open it as a URL
if (message.length() > 0) {
DependencyManager::get<WindowScriptingInterface>()->openUrl(QString::fromUtf8(message));
DependencyManager::get<AddressManager>()->handleLookupString(QString::fromUtf8(message));
}
}

View file

@ -262,7 +262,9 @@ int main(int argc, const char* argv[]) {
if (socket.waitForConnected(LOCAL_SERVER_TIMEOUT_MS)) {
if (parser.isSet(urlOption)) {
QUrl url = QUrl(parser.value(urlOption));
if (url.isValid() && (url.scheme() == URL_SCHEME_HIFI || url.scheme() == URL_SCHEME_HIFIAPP)) {
if (url.isValid() && (url.scheme() == URL_SCHEME_HIFI || url.scheme() == URL_SCHEME_HIFIAPP
|| url.scheme() == HIFI_URL_SCHEME_HTTP || url.scheme() == HIFI_URL_SCHEME_HTTPS
|| url.scheme() == HIFI_URL_SCHEME_FILE)) {
qDebug() << "Writing URL to local socket";
socket.write(url.toString().toUtf8());
if (!socket.waitForBytesWritten(5000)) {