RunControl: Simplify some usages of runnable()

Change-Id: I77fbb140469053f0e6cdcccfb7c78857fbb8b7e7
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2025-01-15 14:31:57 +01:00
parent 45c001601e
commit 4de25abef1
5 changed files with 10 additions and 11 deletions

View File

@@ -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);

View File

@@ -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;

View File

@@ -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())

View File

@@ -1633,8 +1633,7 @@ 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) {
d->m_environment.forEachEntry([this](const QString &key, const QString &value, bool enabled) {
if (enabled)
appendMessage(key + '=' + value, StdOutFormat);
});

View File

@@ -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);
});