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;
inferior.executable = bin;
if (auto aspect = runControl()->aspect<ArgumentsAspect>()) {
const auto rc = runControl()->runConfiguration();
inferior.commandLineArguments = aspect->arguments(rc->macroExpander());
}
if (auto aspect = runControl()->aspect<ArgumentsAspect>())
inferior.commandLineArguments = aspect->arguments(runControl()->macroExpander());
setInferior(inferior);
setSymbolFile(bin);
setStartMode(AttachToRemoteServer);

View File

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