forked from qt-creator/qt-creator
QmlProfiler: Unify local and tcp connection mechanism
Use the URL scheme to distinguish between them, check that in QmlProfilerClientManager and test all possible combinations of URL parts. Change-Id: I6583e5bf18eda0344a299a279c12578c4ebc7ffe Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -127,17 +127,10 @@ void QmlProfilerRunner::start()
|
||||
});
|
||||
|
||||
infoBox->show();
|
||||
});
|
||||
|
||||
clientManager->setServerUrl(serverUrl);
|
||||
if (serverUrl.port() != -1) {
|
||||
clientManager->connectToTcpServer();
|
||||
} else {
|
||||
clientManager->startLocalServer();
|
||||
}
|
||||
}, Qt::QueuedConnection); // Queue any connection failures after reportStarted()
|
||||
|
||||
clientManager->connectToServer(serverUrl);
|
||||
d->m_profilerState->setCurrentState(QmlProfilerStateManager::AppRunning);
|
||||
|
||||
reportStarted();
|
||||
}
|
||||
|
||||
@@ -284,9 +277,13 @@ LocalQmlProfilerSupport::LocalQmlProfilerSupport(RunControl *runControl, const Q
|
||||
|
||||
StandardRunnable debuggee = runnable().as<StandardRunnable>();
|
||||
|
||||
QString code = serverUrl.scheme() == "socket"
|
||||
? QString("file:%1").arg(serverUrl.path())
|
||||
: QString("port:%1").arg(serverUrl.port());
|
||||
QString code;
|
||||
if (serverUrl.scheme() == urlSocketScheme())
|
||||
code = QString("file:%1").arg(serverUrl.path());
|
||||
else if (serverUrl.scheme() == urlTcpScheme())
|
||||
code = QString("port:%1").arg(serverUrl.port());
|
||||
else
|
||||
QTC_CHECK(false);
|
||||
|
||||
QString arguments = QmlDebug::qmlDebugCommandLineArguments(QmlDebug::QmlProfilerServices,
|
||||
code, true);
|
||||
|
||||
Reference in New Issue
Block a user