mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 06:18:52 +02:00
Fix sending URL to second interface instance
This commit is contained in:
parent
c1e114c576
commit
fe4c161cb6
1 changed files with 11 additions and 7 deletions
|
@ -78,8 +78,11 @@ int main(int argc, const char* argv[]) {
|
||||||
if (parser.isSet(urlOption)) {
|
if (parser.isSet(urlOption)) {
|
||||||
QUrl url = QUrl(parser.value(urlOption));
|
QUrl url = QUrl(parser.value(urlOption));
|
||||||
if (url.isValid() && url.scheme() == HIFI_URL_SCHEME) {
|
if (url.isValid() && url.scheme() == HIFI_URL_SCHEME) {
|
||||||
|
qDebug() << "Writing URL to local socket";
|
||||||
socket.write(url.toString().toUtf8());
|
socket.write(url.toString().toUtf8());
|
||||||
socket.waitForBytesWritten(5000);
|
if (!socket.waitForBytesWritten(5000)) {
|
||||||
|
qDebug() << "Error writing URL to local socket";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,12 +98,6 @@ int main(int argc, const char* argv[]) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Setup local server
|
|
||||||
QLocalServer server;
|
|
||||||
|
|
||||||
// We failed to connect to a local server, so we remove any existing servers.
|
|
||||||
server.removeServer(applicationName);
|
|
||||||
server.listen(applicationName);
|
|
||||||
|
|
||||||
QElapsedTimer startupTime;
|
QElapsedTimer startupTime;
|
||||||
startupTime.start();
|
startupTime.start();
|
||||||
|
@ -125,6 +122,13 @@ int main(int argc, const char* argv[]) {
|
||||||
QSettings::setDefaultFormat(QSettings::IniFormat);
|
QSettings::setDefaultFormat(QSettings::IniFormat);
|
||||||
Application app(argc, const_cast<char**>(argv), startupTime);
|
Application app(argc, const_cast<char**>(argv), startupTime);
|
||||||
|
|
||||||
|
// Setup local server
|
||||||
|
QLocalServer server { &app };
|
||||||
|
|
||||||
|
// We failed to connect to a local server, so we remove any existing servers.
|
||||||
|
server.removeServer(applicationName);
|
||||||
|
server.listen(applicationName);
|
||||||
|
|
||||||
QObject::connect(&server, &QLocalServer::newConnection, &app, &Application::handleLocalServerConnection);
|
QObject::connect(&server, &QLocalServer::newConnection, &app, &Application::handleLocalServerConnection);
|
||||||
|
|
||||||
QTranslator translator;
|
QTranslator translator;
|
||||||
|
|
Loading…
Reference in a new issue