forked from qt-creator/qt-creator
QmlProfiling: Support both IPv4 and IPv6
Change-Id: Idb0ceb27eabff33da3db52b0b62077083e8893ba Reviewed-by: Christiaan Janssen <christiaan.janssen@digia.com>
This commit is contained in:
@@ -122,7 +122,7 @@ QmlProfilerEngine::QmlProfilerEnginePrivate::createRunner(ProjectExplorer::RunCo
|
|||||||
ProjectExplorer::DeviceKitInformation::device(runConfiguration->target()->kit());
|
ProjectExplorer::DeviceKitInformation::device(runConfiguration->target()->kit());
|
||||||
QTC_ASSERT(device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE, return 0);
|
QTC_ASSERT(device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE, return 0);
|
||||||
QTcpServer server;
|
QTcpServer server;
|
||||||
if (!server.listen(QHostAddress(QLatin1String("127.0.0.1"))))
|
if (!server.listen(QHostAddress::LocalHost) || !server.listen(QHostAddress::LocalHostIPv6))
|
||||||
return 0;
|
return 0;
|
||||||
conf.port = server.serverPort();
|
conf.port = server.serverPort();
|
||||||
runner = new LocalQmlProfilerRunner(conf, parent);
|
runner = new LocalQmlProfilerRunner(conf, parent);
|
||||||
|
@@ -318,7 +318,6 @@ AnalyzerStartParameters QmlProfilerTool::createStartParameters(RunConfiguration
|
|||||||
sp.debuggee = rc1->observerPath();
|
sp.debuggee = rc1->observerPath();
|
||||||
sp.debuggeeArgs = rc1->viewerArguments();
|
sp.debuggeeArgs = rc1->viewerArguments();
|
||||||
sp.displayName = rc1->displayName();
|
sp.displayName = rc1->displayName();
|
||||||
sp.connParams.host = QLatin1String("localhost");
|
|
||||||
} else if (LocalApplicationRunConfiguration *rc2 =
|
} else if (LocalApplicationRunConfiguration *rc2 =
|
||||||
qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration)) {
|
qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration)) {
|
||||||
if (environment)
|
if (environment)
|
||||||
@@ -327,7 +326,6 @@ AnalyzerStartParameters QmlProfilerTool::createStartParameters(RunConfiguration
|
|||||||
sp.debuggee = rc2->executable();
|
sp.debuggee = rc2->executable();
|
||||||
sp.debuggeeArgs = rc2->commandLineArguments();
|
sp.debuggeeArgs = rc2->commandLineArguments();
|
||||||
sp.displayName = rc2->displayName();
|
sp.displayName = rc2->displayName();
|
||||||
sp.connParams.host = QLatin1String("localhost");
|
|
||||||
} else if (RemoteLinux::RemoteLinuxRunConfiguration *rc3 =
|
} else if (RemoteLinux::RemoteLinuxRunConfiguration *rc3 =
|
||||||
qobject_cast<RemoteLinux::RemoteLinuxRunConfiguration *>(runConfiguration)) {
|
qobject_cast<RemoteLinux::RemoteLinuxRunConfiguration *>(runConfiguration)) {
|
||||||
sp.debuggee = rc3->remoteExecutableFilePath();
|
sp.debuggee = rc3->remoteExecutableFilePath();
|
||||||
@@ -344,8 +342,9 @@ AnalyzerStartParameters QmlProfilerTool::createStartParameters(RunConfiguration
|
|||||||
ProjectExplorer::DeviceKitInformation::device(runConfiguration->target()->kit());
|
ProjectExplorer::DeviceKitInformation::device(runConfiguration->target()->kit());
|
||||||
if (device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) {
|
if (device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) {
|
||||||
QTcpServer server;
|
QTcpServer server;
|
||||||
if (!server.listen(QHostAddress(sp.connParams.host)))
|
if (!server.listen(QHostAddress::LocalHost) || !server.listen(QHostAddress::LocalHostIPv6))
|
||||||
return sp;
|
return sp;
|
||||||
|
sp.connParams.host = server.serverAddress().toString();
|
||||||
sp.connParams.port = server.serverPort();
|
sp.connParams.port = server.serverPort();
|
||||||
}
|
}
|
||||||
sp.startMode = StartQml;
|
sp.startMode = StartQml;
|
||||||
|
Reference in New Issue
Block a user