mirror of
https://github.com/lubosz/overte.git
synced 2025-04-26 19:55:27 +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)) {
|
||||
QUrl url = QUrl(parser.value(urlOption));
|
||||
if (url.isValid() && url.scheme() == HIFI_URL_SCHEME) {
|
||||
qDebug() << "Writing URL to local socket";
|
||||
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
|
||||
}
|
||||
|
||||
// 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;
|
||||
startupTime.start();
|
||||
|
@ -125,6 +122,13 @@ int main(int argc, const char* argv[]) {
|
|||
QSettings::setDefaultFormat(QSettings::IniFormat);
|
||||
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);
|
||||
|
||||
QTranslator translator;
|
||||
|
|
Loading…
Reference in a new issue