diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2018-01-09 11:14:39 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2018-01-09 17:02:05 +0000 |
commit | 58ae456f4be17ffcb749143d47388207fb2f7ead (patch) | |
tree | ab5d93052aceecf216959f9e126e0c448c26f0b9 /src/plugins/qmlprofiler/qmlprofilertool.cpp | |
parent | becbcd4455a0062de91673337e8275862aedb64b (diff) |
QmlProfiler: Verify attached RunControl stops when connection closes
Change-Id: I2b7bd63c4e84fcb0e78318f810ed54e58468d05e
Task-number: QTCREATORBUG-19496
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/qmlprofiler/qmlprofilertool.cpp')
-rw-r--r-- | src/plugins/qmlprofiler/qmlprofilertool.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index 99c2cf12860..cb2bcb59a84 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -526,10 +526,10 @@ bool QmlProfilerTool::prepareTool() return true; } -void QmlProfilerTool::attachToWaitingApplication() +ProjectExplorer::RunControl *QmlProfilerTool::attachToWaitingApplication() { if (!prepareTool()) - return; + return nullptr; Id kitId; int port; @@ -547,12 +547,12 @@ void QmlProfilerTool::attachToWaitingApplication() dialog.setPort(port); if (dialog.exec() != QDialog::Accepted) - return; + return nullptr; kit = dialog.kit(); port = dialog.port(); - QTC_ASSERT(port >= 0, return); - QTC_ASSERT(port <= std::numeric_limits<quint16>::max(), return); + QTC_ASSERT(port >= 0, return nullptr); + QTC_ASSERT(port <= std::numeric_limits<quint16>::max(), return nullptr); settings->setValue(QLatin1String("AnalyzerQmlAttachDialog/kitId"), kit->id().toSetting()); settings->setValue(QLatin1String("AnalyzerQmlAttachDialog/port"), port); @@ -561,7 +561,7 @@ void QmlProfilerTool::attachToWaitingApplication() QUrl serverUrl; IDevice::ConstPtr device = DeviceKitInformation::device(kit); - QTC_ASSERT(device, return); + QTC_ASSERT(device, return nullptr); QUrl toolControl = device->toolControlChannel(IDevice::QmlControlChannel); serverUrl.setScheme(Utils::urlTcpScheme()); serverUrl.setHost(toolControl.host()); @@ -577,6 +577,7 @@ void QmlProfilerTool::attachToWaitingApplication() connect(d->m_profilerConnections, &QmlProfilerClientManager::connectionClosed, runControl, &RunControl::initiateStop); ProjectExplorerPlugin::startRunControl(runControl); + return runControl; } void QmlProfilerTool::logState(const QString &msg) |