ProjectExplorer: Copy more RunConfiguration data to RunControl

The aspects are now responsible for defining what data needs
to be copied and also to provide a suitable interface (kind
of source-compatible to direct use) for access.

The important change here is that RunControl::aspect(...) doesn't
need to access RunControl::runConfiguration() in fully aspectified
RunConfigurations anymore. In not-fully aspectified the runConfig
access is moved to the user code to make the problem visible there.
Long term, aspectification should be finished.

As an additional benefit, the resolving of macros etc can
now be done at the correct time.

Change-Id: I690d9f8f696ce9b4efd42082ba3f81b514efcb77
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2022-04-08 11:35:54 +02:00
parent 24b4a7be74
commit 530b9ae85a
33 changed files with 282 additions and 54 deletions

View File

@@ -868,11 +868,11 @@ DebuggerRunTool::DebuggerRunTool(RunControl *runControl, AllowTerminal allowTerm
m_runParameters.displayName = runControl->displayName();
if (auto symbolsAspect = runControl->aspect<SymbolFileAspect>())
m_runParameters.symbolFile = symbolsAspect->filePath();
m_runParameters.symbolFile = symbolsAspect->filePath;
if (auto terminalAspect = runControl->aspect<TerminalAspect>())
m_runParameters.useTerminal = terminalAspect->useTerminal();
m_runParameters.useTerminal = terminalAspect->useTerminal;
if (auto runAsRootAspect = runControl->aspect<RunAsRootAspect>())
m_runParameters.runAsRoot = runAsRootAspect->value();
m_runParameters.runAsRoot = runAsRootAspect->value;
Kit *kit = runControl->kit();
QTC_ASSERT(kit, return);
@@ -886,13 +886,13 @@ DebuggerRunTool::DebuggerRunTool(RunControl *runControl, AllowTerminal allowTerm
m_runParameters.qtPackageSourceLocation = qtVersion->qtPackageSourcePath().toString();
if (auto aspect = runControl->aspect<DebuggerRunConfigurationAspect>()) {
if (!aspect->useCppDebugger())
if (!aspect->useCppDebugger)
m_runParameters.cppEngineType = NoEngineType;
m_runParameters.isQmlDebugging = aspect->useQmlDebugger();
m_runParameters.multiProcess = aspect->useMultiProcess();
m_runParameters.additionalStartupCommands = aspect->overrideStartup();
m_runParameters.isQmlDebugging = aspect->useQmlDebugger;
m_runParameters.multiProcess = aspect->useMultiProcess;
m_runParameters.additionalStartupCommands = aspect->overrideStartup;
if (aspect->useCppDebugger()) {
if (aspect->useCppDebugger) {
if (DebuggerKitAspect::debugger(kit)) {
const Tasks tasks = DebuggerKitAspect::validateDebugger(kit);
for (const Task &t : tasks) {