From 4de25abef145673025c711af328e238450398c7b Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Wed, 15 Jan 2025 14:31:57 +0100 Subject: [PATCH] RunControl: Simplify some usages of runnable() Change-Id: I77fbb140469053f0e6cdcccfb7c78857fbb8b7e7 Reviewed-by: hjk --- .../baremetal/debugservers/gdb/gdbserverprovider.cpp | 6 +++--- .../baremetal/debugservers/uvsc/uvscserverprovider.cpp | 2 +- src/plugins/debugger/debuggerruncontrol.cpp | 2 +- src/plugins/projectexplorer/runcontrol.cpp | 9 ++++----- .../qtapplicationmanager/appmanagerruncontrol.cpp | 2 +- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp b/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp index 642e9efb5d7..cc176c618a0 100644 --- a/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/gdb/gdbserverprovider.cpp @@ -127,8 +127,8 @@ bool GdbServerProvider::isValid() const bool GdbServerProvider::aboutToRun(DebuggerRunTool *runTool, QString &errorMessage) const { QTC_ASSERT(runTool, return false); - const ProcessRunData runnable = runTool->runControl()->runnable(); - const FilePath bin = FilePath::fromString(runnable.command.executable().path()); + const CommandLine cmd = runTool->runControl()->commandLine(); + const FilePath bin = FilePath::fromString(cmd.executable().path()); if (bin.isEmpty()) { errorMessage = Tr::tr("Cannot debug: Local executable is not set."); return false; @@ -141,7 +141,7 @@ bool GdbServerProvider::aboutToRun(DebuggerRunTool *runTool, QString &errorMessa ProcessRunData inferior; inferior.command.setExecutable(bin); - inferior.command.setArguments(runnable.command.arguments()); + inferior.command.setArguments(cmd.arguments()); DebuggerRunParameters &rp = runTool->runParameters(); rp.setInferior(inferior); rp.setSymbolFile(bin); diff --git a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp index bb33df5f4cf..9017919623e 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/uvscserverprovider.cpp @@ -162,7 +162,7 @@ QString UvscServerProvider::channelString() const bool UvscServerProvider::aboutToRun(DebuggerRunTool *runTool, QString &errorMessage) const { QTC_ASSERT(runTool, return false); - const FilePath bin = runTool->runControl()->runnable().command.executable(); + const FilePath bin = runTool->runControl()->commandLine().executable(); if (bin.isEmpty()) { errorMessage = Tr::tr("Cannot debug: Local executable is not set."); return false; diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index d699122d7c4..beea9451df7 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -632,7 +632,7 @@ void DebuggerRunTool::startDebugServerIfNeededAndContinueStartup() if (m_runParameters.serverAttachPid().isValid()) cmd.addArgs({"--attach", QString::number(m_runParameters.serverAttachPid().pid())}); else - cmd.addCommandLineAsArgs(runControl()->runnable().command); + cmd.addCommandLineAsArgs(runControl()->commandLine()); } else { // Something resembling gdbserver if (m_runParameters.serverUseMulti()) diff --git a/src/plugins/projectexplorer/runcontrol.cpp b/src/plugins/projectexplorer/runcontrol.cpp index 9354e3b0100..64ead7da11d 100644 --- a/src/plugins/projectexplorer/runcontrol.cpp +++ b/src/plugins/projectexplorer/runcontrol.cpp @@ -1633,11 +1633,10 @@ void ProcessRunner::start() appendMessage(msg, NormalMessageFormat); if (runControl()->isPrintEnvironmentEnabled()) { appendMessage(Tr::tr("Environment:"), NormalMessageFormat); - runControl()->runnable().environment - .forEachEntry([this](const QString &key, const QString &value, bool enabled) { - if (enabled) - appendMessage(key + '=' + value, StdOutFormat); - }); + d->m_environment.forEachEntry([this](const QString &key, const QString &value, bool enabled) { + if (enabled) + appendMessage(key + '=' + value, StdOutFormat); + }); appendMessage({}, StdOutFormat); } diff --git a/src/plugins/qtapplicationmanager/appmanagerruncontrol.cpp b/src/plugins/qtapplicationmanager/appmanagerruncontrol.cpp index 179bc0fd62c..107319f7698 100644 --- a/src/plugins/qtapplicationmanager/appmanagerruncontrol.cpp +++ b/src/plugins/qtapplicationmanager/appmanagerruncontrol.cpp @@ -193,7 +193,7 @@ public: worker->setId("ApplicationManagerPlugin.Run.TargetRunner"); QObject::connect(worker, &RunWorker::stopped, worker, [worker, runControl] { worker->appendMessage( - Tr::tr("%1 exited.").arg(runControl->runnable().command.toUserOutput()), + Tr::tr("%1 exited.").arg(runControl->commandLine().toUserOutput()), OutputFormat::NormalMessageFormat); });