QML Profiler: Fix server URL

QMLProfileRunner should use server URL from the ports gatherer
instead of trying to read it from the data record.

Amends: 94b63ad3b4

Fixes: QTCREATORBUG-31847
Change-Id: Id54429f09cc10f17d763ede6db4df1fad8a323fe
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Andrii Semkiv
2024-10-23 09:17:06 +02:00
parent 48c311b8f3
commit a22e79f38c
3 changed files with 4 additions and 11 deletions

View File

@@ -162,15 +162,9 @@ void QmlProfilerRunner::profilerStateChanged()
}
}
void QmlProfilerRunner::setServerUrl(const QUrl &serverUrl)
{
recordData(QmlServerUrl, serverUrl);
}
QUrl QmlProfilerRunner::serverUrl() const
{
QVariant recordedServer = recordedData(QmlServerUrl);
return recordedServer.toUrl();
return runControl()->qmlChannel();
}
//
@@ -205,7 +199,6 @@ LocalQmlProfilerSupport::LocalQmlProfilerSupport(RunControl *runControl, const Q
setId("LocalQmlProfilerSupport");
auto profiler = new QmlProfilerRunner(runControl);
profiler->setServerUrl(serverUrl);
addStopDependency(profiler);
// We need to open the local server before the application tries to connect.

View File

@@ -24,7 +24,6 @@ public:
QmlProfilerRunner(ProjectExplorer::RunControl *runControl);
~QmlProfilerRunner() override;
void setServerUrl(const QUrl &serverUrl);
QUrl serverUrl() const;
void registerProfilerStateManager( QmlProfilerStateManager *profilerState );

View File

@@ -603,8 +603,9 @@ ProjectExplorer::RunControl *QmlProfilerTool::attachToWaitingApplication()
auto runControl = new RunControl(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE);
runControl->copyDataFromRunConfiguration(ProjectManager::startupRunConfiguration());
auto profiler = new QmlProfilerRunner(runControl);
profiler->setServerUrl(serverUrl);
// The object as such is needed, the RunWorker becomes part of the RunControl at construction time,
// similar to how QObject children are owned by their parents
[[maybe_unused]] auto profiler = new QmlProfilerRunner(runControl);
connect(d->m_profilerConnections, &QmlProfilerClientManager::connectionClosed,
runControl, &RunControl::initiateStop);