Limit scope of uses of RunControl::runConfiguration()

Change-Id: Iccd9c0ce869060367db606b3c338bf21b2299548
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
hjk
2019-03-13 18:09:27 +01:00
parent 330af3309c
commit 60f18b6170
2 changed files with 6 additions and 8 deletions

View File

@@ -122,10 +122,8 @@ void BareMetalDebugSupport::start()
Runnable inferior; Runnable inferior;
inferior.executable = bin; inferior.executable = bin;
if (auto aspect = runControl()->aspect<ArgumentsAspect>()) { if (auto aspect = runControl()->aspect<ArgumentsAspect>())
const auto rc = runControl()->runConfiguration(); inferior.commandLineArguments = aspect->arguments(runControl()->macroExpander());
inferior.commandLineArguments = aspect->arguments(rc->macroExpander());
}
setInferior(inferior); setInferior(inferior);
setSymbolFile(bin); setSymbolFile(bin);
setStartMode(AttachToRemoteServer); setStartMode(AttachToRemoteServer);

View File

@@ -74,14 +74,14 @@ QmlPreviewRunner::QmlPreviewRunner(ProjectExplorer::RunControl *runControl,
}); });
connect(m_connectionManager.data(), &Internal::QmlPreviewConnectionManager::restart, connect(m_connectionManager.data(), &Internal::QmlPreviewConnectionManager::restart,
runControl, [runControl, this]() { runControl, [runControl]() {
if (!runControl->isRunning()) if (!runControl->isRunning())
return; return;
ProjectExplorer::RunConfiguration *runConfig = runControl->runConfiguration(); connect(runControl, &ProjectExplorer::RunControl::stopped, runControl, [runControl]() {
connect(runControl, &ProjectExplorer::RunControl::stopped, runConfig, [runConfig](){
ProjectExplorer::ProjectExplorerPlugin::runRunConfiguration( ProjectExplorer::ProjectExplorerPlugin::runRunConfiguration(
runConfig, ProjectExplorer::Constants::QML_PREVIEW_RUN_MODE, true); runControl->runConfiguration(),
ProjectExplorer::Constants::QML_PREVIEW_RUN_MODE, true);
}); });
runControl->initiateStop(); runControl->initiateStop();