forked from qt-creator/qt-creator
QmlPreview: Fix socket connection on macOS
With Design Studio branding the temporary path got just too long (107 chars). Make the file name shorter, and add a warning for future reference. Change-Id: Id5ff448d55a8b109234b7c113695ea54b1836a2f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -47,7 +47,13 @@ QUrl urlFromLocalSocket()
|
||||
{
|
||||
QUrl serverUrl;
|
||||
serverUrl.setScheme(urlSocketScheme());
|
||||
TemporaryFile file("qtcreator-freesocket");
|
||||
TemporaryFile file("qtc-socket");
|
||||
// see "man unix" for unix socket file name size limitations
|
||||
if (file.fileName().size() > 104) {
|
||||
qWarning().nospace()
|
||||
<< "Socket file name \"" << file.fileName()
|
||||
<< "\" is larger than 104 characters, which will not work on Darwin/macOS/Linux!";
|
||||
}
|
||||
if (file.open())
|
||||
serverUrl.setPath(file.fileName());
|
||||
return serverUrl;
|
||||
|
||||
Reference in New Issue
Block a user