QmlProjectManager: Avoid use of RunControl::runConfiguration()

The RunConfiguration might change and even die after the runcontrol
starts.

Change-Id: I628f3ae26c21fb41388b6104497ce5a6a6704c8a
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
hjk
2022-04-11 09:53:55 +02:00
parent 6db23acc1f
commit 2ea397f11d
3 changed files with 18 additions and 5 deletions

View File

@@ -449,11 +449,6 @@ void QmlPreviewPluginPrivate::setDirty()
void QmlPreviewPluginPrivate::addPreview(ProjectExplorer::RunControl *preview)
{
m_runningPreviews.append(preview);
if (auto multiLanguageAspect =
preview->runConfiguration()->aspect<QmlProjectManager::QmlMultiLanguageAspect>()) {
connect(multiLanguageAspect, &QmlProjectManager::QmlMultiLanguageAspect::changed,
preview, &ProjectExplorer::RunControl::initiateStop);
}
emit q->runningPreviewsChanged(m_runningPreviews);
}