forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/2.8' into HEAD
Conflicts: src/plugins/coreplugin/editormanager/editormanager.cpp Change-Id: I59ce346c85803f5496a22bdadf7dca09e59d3174
This commit is contained in:
@@ -413,18 +413,24 @@ void QmlEngine::beginConnection(quint16 port)
|
||||
if (host.isEmpty())
|
||||
host = QLatin1String("localhost");
|
||||
|
||||
if (port > 0) {
|
||||
QTC_ASSERT(startParameters().connParams.port == 0
|
||||
|| startParameters().connParams.port == port,
|
||||
qWarning() << "Port " << port << "from application output does not match"
|
||||
<< startParameters().connParams.port << "from start parameters.");
|
||||
m_adapter.beginConnectionTcp(host, port);
|
||||
return;
|
||||
}
|
||||
// no port from application output, use the one from start parameters ...
|
||||
m_adapter.beginConnectionTcp(host, startParameters().qmlServerPort);
|
||||
/*
|
||||
* Let plugin-specific code override the port printed by the application. This is necessary
|
||||
* in the case of port forwarding, when the port the application listens on is not the same that
|
||||
* we want to connect to.
|
||||
* NOTE: It is still necessary to wait for the output in that case, because otherwise we cannot
|
||||
* be sure that the port is already open. The usual method of trying to connect repeatedly
|
||||
* will not work, because the intermediate port is already open. So the connection
|
||||
* will be accepted on that port but the forwarding to the target port will fail and
|
||||
* the connection will be closed again (instead of returning the "connection refused"
|
||||
* error that we expect).
|
||||
*/
|
||||
if (startParameters().qmlServerPort > 0)
|
||||
port = startParameters().qmlServerPort;
|
||||
|
||||
m_adapter.beginConnectionTcp(host, port);
|
||||
}
|
||||
|
||||
|
||||
void QmlEngine::connectionStartupFailed()
|
||||
{
|
||||
if (m_retryOnConnectFail) {
|
||||
|
||||
Reference in New Issue
Block a user