Commit b85eddb2 authored by Aurindam Jana's avatar Aurindam Jana
Browse files

QmlDebugging: Support both IPv4 and IPv6



Change-Id: I562780c0894f596863c4c8b9cc9b12e3a3a98f33
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
Reviewed-by: default avatarAurindam Jana <aurindam.jana@digia.com>
parent f9d2b649
......@@ -382,15 +382,16 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu
if (debugger->useQmlDebugger()) {
const ProjectExplorer::IDevice::ConstPtr device =
DeviceKitInformation::device(runConfiguration->target()->kit());
sp.qmlServerAddress = _("127.0.0.1");
QTC_ASSERT(device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE, return sp);
QTcpServer server;
const bool canListen = server.listen(QHostAddress(sp.qmlServerAddress));
const bool canListen = server.listen(QHostAddress::LocalHost)
|| server.listen(QHostAddress::LocalHostIPv6);
if (!canListen) {
if (errorMessage)
*errorMessage = DebuggerPlugin::tr("Not enough free ports for QML debugging. ");
return sp;
}
sp.qmlServerAddress = server.serverAddress().toString();
sp.qmlServerPort = server.serverPort();
sp.languages |= QmlLanguage;
......
......@@ -218,15 +218,16 @@ RunControl *QmlProjectRunControlFactory::createDebugRunControl(QmlProjectRunConf
if (debugger->useQmlDebugger()) {
const ProjectExplorer::IDevice::ConstPtr device =
DeviceKitInformation::device(runConfig->target()->kit());
params.qmlServerAddress = QLatin1String("127.0.0.1");
QTC_ASSERT(device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE, return 0);
QTcpServer server;
const bool canListen = server.listen(QHostAddress(params.qmlServerAddress));
const bool canListen = server.listen(QHostAddress::LocalHost)
|| server.listen(QHostAddress::LocalHostIPv6);
if (!canListen) {
if (errorMessage)
*errorMessage = tr("Not enough free ports for QML debugging. ");
return 0;
}
params.qmlServerAddress = server.serverAddress().toString();
params.qmlServerPort = server.serverPort();
params.languages |= Debugger::QmlLanguage;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment