From 686b63ea84d36d8b0294320799f9b2ce9955982a Mon Sep 17 00:00:00 2001 From: Aurindam Jana Date: Thu, 18 Apr 2013 10:39:48 +0200 Subject: [PATCH] QmlProfiling: Support both IPv4 and IPv6 Change-Id: Idb0ceb27eabff33da3db52b0b62077083e8893ba Reviewed-by: Christiaan Janssen --- src/plugins/qmlprofiler/qmlprofilerengine.cpp | 2 +- src/plugins/qmlprofiler/qmlprofilertool.cpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/plugins/qmlprofiler/qmlprofilerengine.cpp b/src/plugins/qmlprofiler/qmlprofilerengine.cpp index 68f90c401b2..d5d4b93bef6 100644 --- a/src/plugins/qmlprofiler/qmlprofilerengine.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerengine.cpp @@ -122,7 +122,7 @@ QmlProfilerEngine::QmlProfilerEnginePrivate::createRunner(ProjectExplorer::RunCo ProjectExplorer::DeviceKitInformation::device(runConfiguration->target()->kit()); QTC_ASSERT(device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE, return 0); QTcpServer server; - if (!server.listen(QHostAddress(QLatin1String("127.0.0.1")))) + if (!server.listen(QHostAddress::LocalHost) || !server.listen(QHostAddress::LocalHostIPv6)) return 0; conf.port = server.serverPort(); runner = new LocalQmlProfilerRunner(conf, parent); diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index 5f11694d577..f01e8641914 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -318,7 +318,6 @@ AnalyzerStartParameters QmlProfilerTool::createStartParameters(RunConfiguration sp.debuggee = rc1->observerPath(); sp.debuggeeArgs = rc1->viewerArguments(); sp.displayName = rc1->displayName(); - sp.connParams.host = QLatin1String("localhost"); } else if (LocalApplicationRunConfiguration *rc2 = qobject_cast(runConfiguration)) { if (environment) @@ -327,7 +326,6 @@ AnalyzerStartParameters QmlProfilerTool::createStartParameters(RunConfiguration sp.debuggee = rc2->executable(); sp.debuggeeArgs = rc2->commandLineArguments(); sp.displayName = rc2->displayName(); - sp.connParams.host = QLatin1String("localhost"); } else if (RemoteLinux::RemoteLinuxRunConfiguration *rc3 = qobject_cast(runConfiguration)) { sp.debuggee = rc3->remoteExecutableFilePath(); @@ -344,8 +342,9 @@ AnalyzerStartParameters QmlProfilerTool::createStartParameters(RunConfiguration ProjectExplorer::DeviceKitInformation::device(runConfiguration->target()->kit()); if (device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) { QTcpServer server; - if (!server.listen(QHostAddress(sp.connParams.host))) + if (!server.listen(QHostAddress::LocalHost) || !server.listen(QHostAddress::LocalHostIPv6)) return sp; + sp.connParams.host = server.serverAddress().toString(); sp.connParams.port = server.serverPort(); } sp.startMode = StartQml;