forked from qt-creator/qt-creator
ProjectExplorer: Introduce a ProjectConfiguration::kit() function
For convenience, and use it in some places. Change-Id: I8f7cb502b37b2fbf4cf2d17cac9c6299558332dc Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -98,7 +98,7 @@ private:
|
||||
IosBuildSettingsWidget::IosBuildSettingsWidget(IosBuildConfiguration *bc)
|
||||
: NamedWidget(IosBuildConfiguration::tr("iOS Settings")),
|
||||
m_bc(bc),
|
||||
m_isDevice(DeviceTypeKitAspect::deviceTypeId(bc->target()->kit())
|
||||
m_isDevice(DeviceTypeKitAspect::deviceTypeId(bc->kit())
|
||||
== Constants::IOS_DEVICE_TYPE)
|
||||
{
|
||||
auto detailsWidget = new Utils::DetailsWidget(this);
|
||||
@@ -423,7 +423,7 @@ void IosBuildConfiguration::updateQmakeCommand()
|
||||
if (signingIdentifier.isEmpty() )
|
||||
extraArgs << forceOverrideArg;
|
||||
|
||||
Utils::Id devType = DeviceTypeKitAspect::deviceTypeId(target()->kit());
|
||||
Utils::Id devType = DeviceTypeKitAspect::deviceTypeId(kit());
|
||||
if (devType == Constants::IOS_DEVICE_TYPE && !signingIdentifier.isEmpty()) {
|
||||
if (m_autoManagedSigning->value()) {
|
||||
extraArgs << qmakeIosTeamSettings + signingIdentifier;
|
||||
|
||||
@@ -171,7 +171,7 @@ bool IosBuildStep::init()
|
||||
{
|
||||
BuildConfiguration *bc = buildConfiguration();
|
||||
|
||||
ToolChain *tc = ToolChainKitAspect::cxxToolChain(target()->kit());
|
||||
ToolChain *tc = ToolChainKitAspect::cxxToolChain(kit());
|
||||
if (!tc)
|
||||
emit addTask(Task::compilerMissingTask());
|
||||
|
||||
@@ -190,7 +190,7 @@ bool IosBuildStep::init()
|
||||
void IosBuildStep::setupOutputFormatter(OutputFormatter *formatter)
|
||||
{
|
||||
formatter->addLineParser(new GnuMakeParser);
|
||||
formatter->addLineParsers(target()->kit()->createOutputParsers());
|
||||
formatter->addLineParsers(kit()->createOutputParsers());
|
||||
formatter->addSearchDir(processParameters()->effectiveWorkingDirectory());
|
||||
AbstractProcessStep::setupOutputFormatter(formatter);
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ IosDeployStep::IosDeployStep(BuildStepList *parent, Utils::Id id)
|
||||
|
||||
void IosDeployStep::updateDisplayNames()
|
||||
{
|
||||
IDevice::ConstPtr dev = DeviceKitAspect::device(target()->kit());
|
||||
IDevice::ConstPtr dev = DeviceKitAspect::device(kit());
|
||||
const QString devName = dev.isNull() ? IosDevice::name() : dev->displayName();
|
||||
setDefaultDisplayName(tr("Deploy to %1").arg(devName));
|
||||
setDisplayName(tr("Deploy to %1").arg(devName));
|
||||
@@ -121,7 +121,7 @@ void IosDeployStep::updateDisplayNames()
|
||||
bool IosDeployStep::init()
|
||||
{
|
||||
QTC_ASSERT(m_transferStatus == NoTransfer, return false);
|
||||
m_device = DeviceKitAspect::device(target()->kit());
|
||||
m_device = DeviceKitAspect::device(kit());
|
||||
auto runConfig = qobject_cast<const IosRunConfiguration *>(
|
||||
this->target()->activeRunConfiguration());
|
||||
QTC_ASSERT(runConfig, return false);
|
||||
|
||||
@@ -185,7 +185,7 @@ bool IosDsymBuildStep::isDefault() const
|
||||
|
||||
void IosDsymBuildStep::setupOutputFormatter(OutputFormatter *formatter)
|
||||
{
|
||||
formatter->setLineParsers(target()->kit()->createOutputParsers());
|
||||
formatter->setLineParsers(kit()->createOutputParsers());
|
||||
formatter->addSearchDir(processParameters()->effectiveWorkingDirectory());
|
||||
AbstractProcessStep::setupOutputFormatter(formatter);
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ void IosDeviceTypeAspect::deviceChanges()
|
||||
|
||||
void IosDeviceTypeAspect::updateDeviceType()
|
||||
{
|
||||
if (DeviceTypeKitAspect::deviceTypeId(m_runConfiguration->target()->kit())
|
||||
if (DeviceTypeKitAspect::deviceTypeId(m_runConfiguration->kit())
|
||||
== Constants::IOS_DEVICE_TYPE)
|
||||
m_deviceType = IosDeviceType(IosDeviceType::IosDevice);
|
||||
else if (m_deviceType.type == IosDeviceType::IosDevice)
|
||||
@@ -140,11 +140,11 @@ void IosDeviceTypeAspect::updateDeviceType()
|
||||
|
||||
bool IosRunConfiguration::isEnabled() const
|
||||
{
|
||||
Utils::Id devType = DeviceTypeKitAspect::deviceTypeId(target()->kit());
|
||||
Utils::Id devType = DeviceTypeKitAspect::deviceTypeId(kit());
|
||||
if (devType != Constants::IOS_DEVICE_TYPE && devType != Constants::IOS_SIMULATOR_TYPE)
|
||||
return false;
|
||||
|
||||
IDevice::ConstPtr dev = DeviceKitAspect::device(target()->kit());
|
||||
IDevice::ConstPtr dev = DeviceKitAspect::device(kit());
|
||||
if (dev.isNull() || dev->deviceState() != IDevice::DeviceReadyToUse)
|
||||
return false;
|
||||
|
||||
@@ -153,8 +153,7 @@ bool IosRunConfiguration::isEnabled() const
|
||||
|
||||
QString IosRunConfiguration::applicationName() const
|
||||
{
|
||||
Project *project = target()->project();
|
||||
if (ProjectNode *node = project->findNodeForBuildKey(buildKey()))
|
||||
if (ProjectNode *node = project()->findNodeForBuildKey(buildKey()))
|
||||
return node->data(Constants::IosTarget).toString();
|
||||
|
||||
return QString();
|
||||
@@ -162,7 +161,7 @@ QString IosRunConfiguration::applicationName() const
|
||||
|
||||
FilePath IosRunConfiguration::bundleDirectory() const
|
||||
{
|
||||
Utils::Id devType = DeviceTypeKitAspect::deviceTypeId(target()->kit());
|
||||
Utils::Id devType = DeviceTypeKitAspect::deviceTypeId(kit());
|
||||
bool isDevice = (devType == Constants::IOS_DEVICE_TYPE);
|
||||
if (!isDevice && devType != Constants::IOS_SIMULATOR_TYPE) {
|
||||
qCWarning(iosLog) << "unexpected device type in bundleDirForTarget: " << devType.toString();
|
||||
@@ -220,10 +219,10 @@ void IosDeviceTypeAspect::toMap(QVariantMap &map) const
|
||||
|
||||
QString IosRunConfiguration::disabledReason() const
|
||||
{
|
||||
Utils::Id devType = DeviceTypeKitAspect::deviceTypeId(target()->kit());
|
||||
Utils::Id devType = DeviceTypeKitAspect::deviceTypeId(kit());
|
||||
if (devType != Constants::IOS_DEVICE_TYPE && devType != Constants::IOS_SIMULATOR_TYPE)
|
||||
return tr("Kit has incorrect device type for running on iOS devices.");
|
||||
IDevice::ConstPtr dev = DeviceKitAspect::device(target()->kit());
|
||||
IDevice::ConstPtr dev = DeviceKitAspect::device(kit());
|
||||
QString validDevName;
|
||||
bool hasConncetedDev = false;
|
||||
if (devType == Constants::IOS_DEVICE_TYPE) {
|
||||
|
||||
@@ -98,7 +98,7 @@ IosRunner::IosRunner(RunControl *runControl)
|
||||
stopRunningRunControl(runControl);
|
||||
auto runConfig = qobject_cast<IosRunConfiguration *>(runControl->runConfiguration());
|
||||
m_bundleDir = runConfig->bundleDirectory().toString();
|
||||
m_device = DeviceKitAspect::device(runControl->target()->kit());
|
||||
m_device = DeviceKitAspect::device(runControl->kit());
|
||||
m_deviceType = runConfig->deviceType();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user