ProjectExplorer: Replace RunControl::buildTargetInfo

... by two accessors to the only used field. General idea here
is to make the presence of a RunConfiguration in a RunControl
less prominent to be able to remove it at some time completely,
as the configuration's data might change while the control is
running.

Change-Id: I752540fadd135d6904fc9bf4e3506be074b0c003
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-08-07 12:16:48 +02:00
parent ebc2b9ed6f
commit a79957038a
4 changed files with 14 additions and 9 deletions

View File

@@ -891,9 +891,14 @@ QString RunControl::buildKey() const
return d->runConfiguration ? d->runConfiguration->buildKey() : QString();
}
BuildTargetInfo RunControl::buildTargetInfo() const
FilePath RunControl::targetFilePath() const
{
return d->runConfiguration->buildTargetInfo();
return d->runConfiguration->buildTargetInfo().targetFilePath;
}
FilePath RunControl::projectFilePath() const
{
return d->runConfiguration->buildTargetInfo().projectFilePath;
}
/*!

View File

@@ -26,7 +26,6 @@
#pragma once
#include "applicationlauncher.h"
#include "buildtargetinfo.h"
#include "devicesupport/idevice.h"
#include "projectexplorerconstants.h"
#include "runconfiguration.h"
@@ -245,7 +244,9 @@ public:
ISettingsAspect *settings(Core::Id id) const;
QString buildKey() const;
BuildTargetInfo buildTargetInfo() const;
Utils::FilePath targetFilePath() const;
Utils::FilePath projectFilePath() const;
Utils::OutputFormatter *outputFormatter() const;
Core::Id runMode() const;

View File

@@ -75,7 +75,7 @@ WinRtDebugSupport::WinRtDebugSupport(RunControl *runControl)
setQmlServer(qmlServer);
}
setSymbolFile(runControl->buildTargetInfo().targetFilePath);
setSymbolFile(runControl->targetFilePath());
QString errorMessage;
m_runner = new WinRtRunnerHelper(this, &errorMessage);
if (!errorMessage.isEmpty()) {

View File

@@ -69,12 +69,11 @@ WinRtRunnerHelper::WinRtRunnerHelper(ProjectExplorer::RunWorker *runWorker, QStr
return;
}
const BuildTargetInfo bti = runControl->buildTargetInfo();
m_executableFilePath = bti.targetFilePath.toString();
m_executableFilePath = runControl->targetFilePath().toString();
if (m_executableFilePath.isEmpty()) {
*errorMessage = tr("Cannot determine the executable file path for \"%1\".").arg(
QDir::toNativeSeparators(bti.projectFilePath.toString()));
*errorMessage = tr("Cannot determine the executable file path for \"%1\".")
.arg(runControl->projectFilePath().toUserOutput());
return;
}