Files
qt-creator/src/plugins/ios/iosrunconfiguration.cpp

432 lines
15 KiB
C++
Raw Normal View History

/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#include "iosrunconfiguration.h"
#include "iosconstants.h"
#include "iosdeploystep.h"
#include "simulatorcontrol.h"
#include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/buildstep.h>
#include <projectexplorer/buildsteplist.h>
#include <projectexplorer/deployconfiguration.h>
#include <projectexplorer/devicesupport/devicemanager.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/runconfigurationaspects.h>
#include <projectexplorer/target.h>
#include <qmakeprojectmanager/qmakenodes.h>
#include <qmakeprojectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakeprojectmanagerconstants.h>
#include <qtsupport/qtoutputformatter.h>
#include <qtsupport/qtkitinformation.h>
#include <utils/algorithm.h>
#include <utils/fileutils.h>
#include <utils/qtcprocess.h>
#include <utils/qtcassert.h>
#include <QAction>
#include <QApplication>
#include <QComboBox>
#include <QFormLayout>
#include <QHeaderView>
#include <QLabel>
#include <QLineEdit>
#include <QList>
#include <QStandardItemModel>
#include <QVariant>
#include <QWidget>
using namespace ProjectExplorer;
using namespace QmakeProjectManager;
using namespace Utils;
namespace Ios {
namespace Internal {
static const QLatin1String deviceTypeKey("Ios.device_type");
static IosDeviceType toIosDeviceType(const SimulatorInfo &device)
{
IosDeviceType iosDeviceType(IosDeviceType::SimulatedDevice,
device.identifier,
QString("%1, %2").arg(device.name).arg(device.runtimeName));
return iosDeviceType;
}
class IosRunConfigurationWidget : public QWidget
{
public:
IosRunConfigurationWidget(IosRunConfiguration *runConfiguration);
private:
void updateValues();
void setDeviceTypeIndex(int devIndex);
IosRunConfiguration *m_runConfiguration;
QStandardItemModel m_deviceTypeModel;
QLabel *m_deviceTypeLabel;
QLineEdit *m_executableLineEdit;
QComboBox *m_deviceTypeComboBox;
};
IosRunConfiguration::IosRunConfiguration(Target *target, Core::Id id)
: RunConfiguration(target, id)
{
addExtraAspect(new ArgumentsAspect(this, "Ios.run_arguments"));
setOutputFormatter<QtSupport::QtOutputFormatter>();
connect(DeviceManager::instance(), &DeviceManager::updated,
this, &IosRunConfiguration::deviceChanges);
connect(KitManager::instance(), &KitManager::kitsChanged,
this, &IosRunConfiguration::deviceChanges);
}
ProjectExplorer/all: Re-organize BuildSteps/{Deploy,Build}Config setup This follow the rough pattern of recent *RunConfigurationFactory changes for build and deploy configurations. - Collapse the two lines of constructors similar to what 890c1906e6fb2ec did for RunConfigurations * Deploy* was purely mechanical * Build* ctors are split in connects() in the ctor body to create "empty shell for clone" etc and build step additions in initialize() functions which are only used in the create() case. -- Allows to collapse the shared 'ctor()' functions, too. - Move FooBuildConfigurationFactory::create() implementations to FooBuildConfiguration() constructor. That was a strange and unneeded ping-pong between factories and objects, and furthermore allows one level less of indirection (and for a later, left out here, some reduction of the FooBuildConfiguration interfaces that were only used to accommodate the *Factory::create() functions. - Most {Build,Deploy}Configuration{,Factory} classes had a canHandle(), but there wasn't one in the base classses. Have one there. - Most canHandle() functions were checking simple restrictions on e.g. project or target types, specify those by setters in the constructors instead and check them in the base canHandle() - clone() is generally replaced by a creation of a "shell object" and a fromMap(source->toMap()), implemented in the base, there are two cases left for Android and Qbs that needed(?) some extra polish - generally use canHandle() in base implementation, instead of doing that in all Derived::canFoo() - as a result, canCreate/create/canClone/clone reimplementations are not needed anymore, keep the base implementation for now (could be inlined into their only users later), but de-virtualize them. - Combine Ios{Preset,DSym}BuildStepFactory. There was only one 'dsym' build step they could create. - Split the 'mangled' id into the ProjectConfiguration subtype specific constant identifier, and a QString extraId() bit. Only maintain the mangled id in saved settings. - Make ProjectConfiguration::m_id a constant member, adapt all constructors of derived classe. Not done in this patch: - Finish possible cosmetic changes on top - Add a way to specify restrictions to supported Qt versions (used in Android/Ios), as the base implementation does not depend on the qtsupport plugin - Combine the QList<X> availableFoo() + createFoo(X) function pairs to somthing like a direct QList<struct { X; std::function<X()>; }> fooCreators() to avoid e.g. the baseId.withSuffix() <-> id.suffixAfter(base) pingpong - Remove the *Factories from the global object pool - Do something about priority(). Falling back to plain qmake in android+qmake setup is not helpful. Change-Id: I2be7d88d554c5aa8b7db8edf5b93278e1ae0112a Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-11-29 12:28:40 +01:00
void IosRunConfiguration::deviceChanges()
{
updateDeviceType();
updateDisplayNames();
updateEnabledState();
}
void IosRunConfiguration::updateDeviceType()
{
if (DeviceTypeKitInformation::deviceTypeId(target()->kit()) == Constants::IOS_DEVICE_TYPE)
m_deviceType = IosDeviceType(IosDeviceType::IosDevice);
else if (m_deviceType.type == IosDeviceType::IosDevice)
m_deviceType = IosDeviceType(IosDeviceType::SimulatedDevice);
}
QWidget *IosRunConfiguration::createConfigurationWidget()
{
return new IosRunConfigurationWidget(this);
}
void IosRunConfiguration::updateDisplayNames()
{
IDevice::ConstPtr dev = DeviceKitInformation::device(target()->kit());
const QString devName = dev.isNull() ? IosDevice::name() : dev->displayName();
setDefaultDisplayName(tr("Run on %1").arg(devName));
setDisplayName(tr("Run %1 on %2").arg(applicationName()).arg(devName));
}
void IosRunConfiguration::updateEnabledState()
{
Core::Id devType = DeviceTypeKitInformation::deviceTypeId(target()->kit());
if (devType != Constants::IOS_DEVICE_TYPE && devType != Constants::IOS_SIMULATOR_TYPE) {
setEnabled(false);
return;
}
IDevice::ConstPtr dev = DeviceKitInformation::device(target()->kit());
if (dev.isNull() || dev->deviceState() != IDevice::DeviceReadyToUse) {
setEnabled(false);
return;
}
return RunConfiguration::updateEnabledState();
}
bool IosRunConfiguration::canRunForNode(const Node *node) const
{
ProjectExplorer: Consolidate RunConfiguration identifications The previously per-Project/RunConfiguration changing meanings of BuildTargetInfo::buildTarget have by now been split into separate values in BuildTargetInfo: - buildKey a handle to one item in Target::applicationTargetList - displayName a user-visible string in the run settings page The buildKey was tweaked to coincide with the previous 'extraId', i.e. the non-RunConfiguration-type part of the project configuration id that (still) use id mangling. This allows replacing the cases of locally stored seven different versions of buildKey(-ish) data by one RunConfiguration::m_buildKey, and do all remaining extraId handling in RC::{from,to}Map only, i.e. remove the base ProjectConfiguration::extraId() virtual and remove the "re-try fromMap with mangled id" hack entirely. The id mangling is still used to temporarily maintain .user file compatibility in some cases for now, but should be replaced by storing the build key and the RunConfiguration type soon. Qbs already changes in here to only use the uniqueProductName as buildKey, without the previously added display name which is stored as part of the ProjectConfiguration already. It turns out that RunConfiguration::buildSystemTarget was intended and used to retrieve an item from the Target::applicationTargetList for some configurations, coinciding with what buildKey does always. So use that insteand and drop RunConfiguration::buildSystemTarget. There is clearly is further consolidation potential left. handling of (default)displayNames is still a per-runconfiguration mess and there is further consolidation potential left. Change-Id: I448ed30f1b562fb91b970e328a42fa5f6fb2e43e Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-09 12:33:10 +02:00
return node->filePath() == profilePath();
}
IosDeployStep *IosRunConfiguration::deployStep() const
{
DeployConfiguration *config = target()->activeDeployConfiguration();
return config ? config->stepList()->firstOfType<IosDeployStep>() : nullptr;
}
FileName IosRunConfiguration::profilePath() const
{
ProjectExplorer: Consolidate RunConfiguration identifications The previously per-Project/RunConfiguration changing meanings of BuildTargetInfo::buildTarget have by now been split into separate values in BuildTargetInfo: - buildKey a handle to one item in Target::applicationTargetList - displayName a user-visible string in the run settings page The buildKey was tweaked to coincide with the previous 'extraId', i.e. the non-RunConfiguration-type part of the project configuration id that (still) use id mangling. This allows replacing the cases of locally stored seven different versions of buildKey(-ish) data by one RunConfiguration::m_buildKey, and do all remaining extraId handling in RC::{from,to}Map only, i.e. remove the base ProjectConfiguration::extraId() virtual and remove the "re-try fromMap with mangled id" hack entirely. The id mangling is still used to temporarily maintain .user file compatibility in some cases for now, but should be replaced by storing the build key and the RunConfiguration type soon. Qbs already changes in here to only use the uniqueProductName as buildKey, without the previously added display name which is stored as part of the ProjectConfiguration already. It turns out that RunConfiguration::buildSystemTarget was intended and used to retrieve an item from the Target::applicationTargetList for some configurations, coinciding with what buildKey does always. So use that insteand and drop RunConfiguration::buildSystemTarget. There is clearly is further consolidation potential left. handling of (default)displayNames is still a per-runconfiguration mess and there is further consolidation potential left. Change-Id: I448ed30f1b562fb91b970e328a42fa5f6fb2e43e Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-09 12:33:10 +02:00
return FileName::fromString(buildKey());
}
static QmakeProFile *proFile(const IosRunConfiguration *rc)
{
QmakeProject *pro = qobject_cast<QmakeProject *>(rc->target()->project());
QmakeProFile *proFile = pro ? pro->rootProFile() : nullptr;
if (proFile)
proFile = proFile->findProFile(rc->profilePath());
return proFile;
}
QString IosRunConfiguration::applicationName() const
{
QmakeProFile *pro = proFile(this);
if (pro) {
TargetInformation ti = pro->targetInformation();
if (ti.valid)
return ti.target;
}
return QString();
}
FileName IosRunConfiguration::bundleDirectory() const
{
FileName res;
Core::Id devType = DeviceTypeKitInformation::deviceTypeId(target()->kit());
bool isDevice = (devType == Constants::IOS_DEVICE_TYPE);
if (!isDevice && devType != Constants::IOS_SIMULATOR_TYPE) {
qCWarning(iosLog) << "unexpected device type in bundleDirForTarget: " << devType.toString();
return res;
}
if (BuildConfiguration *bc = target()->activeBuildConfiguration()) {
const QmakeProFile *pro = proFile(this);
if (pro) {
TargetInformation ti = pro->targetInformation();
if (ti.valid)
res = ti.buildDir;
}
if (res.isEmpty())
res = bc->buildDirectory();
switch (bc->buildType()) {
case BuildConfiguration::Debug :
case BuildConfiguration::Unknown :
if (isDevice)
res.appendPath(QLatin1String("Debug-iphoneos"));
else
res.appendPath(QLatin1String("Debug-iphonesimulator"));
break;
case BuildConfiguration::Profile :
case BuildConfiguration::Release :
if (isDevice)
res.appendPath(QLatin1String("Release-iphoneos"));
else
res.appendPath(QLatin1String("Release-iphonesimulator"));
break;
default:
qCWarning(iosLog) << "IosBuildStep had an unknown buildType "
<< target()->activeBuildConfiguration()->buildType();
}
}
res.appendPath(applicationName() + QLatin1String(".app"));
return res;
}
FileName IosRunConfiguration::localExecutable() const
{
return bundleDirectory().appendPath(applicationName());
}
bool IosRunConfiguration::fromMap(const QVariantMap &map)
{
ProjectExplorer/all: Re-organize BuildSteps/{Deploy,Build}Config setup This follow the rough pattern of recent *RunConfigurationFactory changes for build and deploy configurations. - Collapse the two lines of constructors similar to what 890c1906e6fb2ec did for RunConfigurations * Deploy* was purely mechanical * Build* ctors are split in connects() in the ctor body to create "empty shell for clone" etc and build step additions in initialize() functions which are only used in the create() case. -- Allows to collapse the shared 'ctor()' functions, too. - Move FooBuildConfigurationFactory::create() implementations to FooBuildConfiguration() constructor. That was a strange and unneeded ping-pong between factories and objects, and furthermore allows one level less of indirection (and for a later, left out here, some reduction of the FooBuildConfiguration interfaces that were only used to accommodate the *Factory::create() functions. - Most {Build,Deploy}Configuration{,Factory} classes had a canHandle(), but there wasn't one in the base classses. Have one there. - Most canHandle() functions were checking simple restrictions on e.g. project or target types, specify those by setters in the constructors instead and check them in the base canHandle() - clone() is generally replaced by a creation of a "shell object" and a fromMap(source->toMap()), implemented in the base, there are two cases left for Android and Qbs that needed(?) some extra polish - generally use canHandle() in base implementation, instead of doing that in all Derived::canFoo() - as a result, canCreate/create/canClone/clone reimplementations are not needed anymore, keep the base implementation for now (could be inlined into their only users later), but de-virtualize them. - Combine Ios{Preset,DSym}BuildStepFactory. There was only one 'dsym' build step they could create. - Split the 'mangled' id into the ProjectConfiguration subtype specific constant identifier, and a QString extraId() bit. Only maintain the mangled id in saved settings. - Make ProjectConfiguration::m_id a constant member, adapt all constructors of derived classe. Not done in this patch: - Finish possible cosmetic changes on top - Add a way to specify restrictions to supported Qt versions (used in Android/Ios), as the base implementation does not depend on the qtsupport plugin - Combine the QList<X> availableFoo() + createFoo(X) function pairs to somthing like a direct QList<struct { X; std::function<X()>; }> fooCreators() to avoid e.g. the baseId.withSuffix() <-> id.suffixAfter(base) pingpong - Remove the *Factories from the global object pool - Do something about priority(). Falling back to plain qmake in android+qmake setup is not helpful. Change-Id: I2be7d88d554c5aa8b7db8edf5b93278e1ae0112a Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-11-29 12:28:40 +01:00
if (!RunConfiguration::fromMap(map))
return false;
bool deviceTypeIsInt;
map.value(deviceTypeKey).toInt(&deviceTypeIsInt);
if (deviceTypeIsInt || !m_deviceType.fromMap(map.value(deviceTypeKey).toMap())) {
updateDeviceType();
}
ProjectExplorer/all: Re-organize BuildSteps/{Deploy,Build}Config setup This follow the rough pattern of recent *RunConfigurationFactory changes for build and deploy configurations. - Collapse the two lines of constructors similar to what 890c1906e6fb2ec did for RunConfigurations * Deploy* was purely mechanical * Build* ctors are split in connects() in the ctor body to create "empty shell for clone" etc and build step additions in initialize() functions which are only used in the create() case. -- Allows to collapse the shared 'ctor()' functions, too. - Move FooBuildConfigurationFactory::create() implementations to FooBuildConfiguration() constructor. That was a strange and unneeded ping-pong between factories and objects, and furthermore allows one level less of indirection (and for a later, left out here, some reduction of the FooBuildConfiguration interfaces that were only used to accommodate the *Factory::create() functions. - Most {Build,Deploy}Configuration{,Factory} classes had a canHandle(), but there wasn't one in the base classses. Have one there. - Most canHandle() functions were checking simple restrictions on e.g. project or target types, specify those by setters in the constructors instead and check them in the base canHandle() - clone() is generally replaced by a creation of a "shell object" and a fromMap(source->toMap()), implemented in the base, there are two cases left for Android and Qbs that needed(?) some extra polish - generally use canHandle() in base implementation, instead of doing that in all Derived::canFoo() - as a result, canCreate/create/canClone/clone reimplementations are not needed anymore, keep the base implementation for now (could be inlined into their only users later), but de-virtualize them. - Combine Ios{Preset,DSym}BuildStepFactory. There was only one 'dsym' build step they could create. - Split the 'mangled' id into the ProjectConfiguration subtype specific constant identifier, and a QString extraId() bit. Only maintain the mangled id in saved settings. - Make ProjectConfiguration::m_id a constant member, adapt all constructors of derived classe. Not done in this patch: - Finish possible cosmetic changes on top - Add a way to specify restrictions to supported Qt versions (used in Android/Ios), as the base implementation does not depend on the qtsupport plugin - Combine the QList<X> availableFoo() + createFoo(X) function pairs to somthing like a direct QList<struct { X; std::function<X()>; }> fooCreators() to avoid e.g. the baseId.withSuffix() <-> id.suffixAfter(base) pingpong - Remove the *Factories from the global object pool - Do something about priority(). Falling back to plain qmake in android+qmake setup is not helpful. Change-Id: I2be7d88d554c5aa8b7db8edf5b93278e1ae0112a Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-11-29 12:28:40 +01:00
updateDisplayNames();
return true;
}
QVariantMap IosRunConfiguration::toMap() const
{
QVariantMap res = RunConfiguration::toMap();
res[deviceTypeKey] = deviceType().toMap();
return res;
}
QString IosRunConfiguration::disabledReason() const
{
Core::Id devType = DeviceTypeKitInformation::deviceTypeId(target()->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 = DeviceKitInformation::device(target()->kit());
QString validDevName;
bool hasConncetedDev = false;
if (devType == Constants::IOS_DEVICE_TYPE) {
DeviceManager *dm = DeviceManager::instance();
for (int idev = 0; idev < dm->deviceCount(); ++idev) {
IDevice::ConstPtr availDev = dm->deviceAt(idev);
if (!availDev.isNull() && availDev->type() == Constants::IOS_DEVICE_TYPE) {
if (availDev->deviceState() == IDevice::DeviceReadyToUse) {
validDevName += QLatin1Char(' ');
validDevName += availDev->displayName();
} else if (availDev->deviceState() == IDevice::DeviceConnected) {
hasConncetedDev = true;
}
}
}
}
if (dev.isNull()) {
if (!validDevName.isEmpty())
return tr("No device chosen. Select %1.").arg(validDevName); // should not happen
else if (hasConncetedDev)
return tr("No device chosen. Enable developer mode on a device."); // should not happen
else
return tr("No device available.");
} else {
switch (dev->deviceState()) {
case IDevice::DeviceReadyToUse:
break;
case IDevice::DeviceConnected:
return tr("To use this device you need to enable developer mode on it.");
case IDevice::DeviceDisconnected:
case IDevice::DeviceStateUnknown:
if (!validDevName.isEmpty())
return tr("%1 is not connected. Select %2?")
.arg(dev->displayName(), validDevName);
else if (hasConncetedDev)
return tr("%1 is not connected. Enable developer mode on a device?")
.arg(dev->displayName());
else
return tr("%1 is not connected.").arg(dev->displayName());
}
}
return RunConfiguration::disabledReason();
}
IosDeviceType IosRunConfiguration::deviceType() const
{
if (m_deviceType.type == IosDeviceType::SimulatedDevice) {
QList<SimulatorInfo> availableSimulators = SimulatorControl::availableSimulators();
if (availableSimulators.isEmpty())
return m_deviceType;
if (Utils::contains(availableSimulators,
Utils::equal(&SimulatorInfo::identifier, m_deviceType.identifier))) {
return m_deviceType;
}
const QStringList parts = m_deviceType.displayName.split(QLatin1Char(','));
if (parts.count() < 2)
return toIosDeviceType(availableSimulators.last());
QList<SimulatorInfo> eligibleDevices;
eligibleDevices = Utils::filtered(availableSimulators, [parts](const SimulatorInfo &info) {
return info.name == parts.at(0) && info.runtimeName == parts.at(1);
});
return toIosDeviceType(eligibleDevices.isEmpty() ? availableSimulators.last()
: eligibleDevices.last());
}
return m_deviceType;
}
void IosRunConfiguration::setDeviceType(const IosDeviceType &deviceType)
{
m_deviceType = deviceType;
}
void IosRunConfiguration::doAdditionalSetup(const RunConfigurationCreationInfo &)
{
updateDeviceType();
updateDisplayNames();
}
IosRunConfigurationWidget::IosRunConfigurationWidget(IosRunConfiguration *runConfiguration)
: m_runConfiguration(runConfiguration)
{
QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
setSizePolicy(sizePolicy);
m_executableLineEdit = new QLineEdit(this);
m_executableLineEdit->setReadOnly(true);
m_deviceTypeComboBox = new QComboBox(this);
m_deviceTypeComboBox->setModel(&m_deviceTypeModel);
m_deviceTypeLabel = new QLabel(IosRunConfiguration::tr("Device type:"), this);
auto layout = new QFormLayout(this);
runConfiguration->extraAspect<ArgumentsAspect>()->addToConfigurationLayout(layout);
layout->addRow(IosRunConfiguration::tr("Executable:"), m_executableLineEdit);
layout->addRow(m_deviceTypeLabel, m_deviceTypeComboBox);
updateValues();
connect(m_deviceTypeComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, &IosRunConfigurationWidget::setDeviceTypeIndex);
connect(runConfiguration, &IosRunConfiguration::localExecutableChanged,
this, &IosRunConfigurationWidget::updateValues);
}
void IosRunConfigurationWidget::setDeviceTypeIndex(int devIndex)
{
QVariant selectedDev = m_deviceTypeModel.data(m_deviceTypeModel.index(devIndex, 0), Qt::UserRole + 1);
if (selectedDev.isValid())
m_runConfiguration->setDeviceType(toIosDeviceType(selectedDev.value<SimulatorInfo>()));
}
void IosRunConfigurationWidget::updateValues()
{
bool showDeviceSelector = m_runConfiguration->deviceType().type != IosDeviceType::IosDevice;
m_deviceTypeLabel->setVisible(showDeviceSelector);
m_deviceTypeComboBox->setVisible(showDeviceSelector);
if (showDeviceSelector && m_deviceTypeModel.rowCount() == 0) {
foreach (const SimulatorInfo &device, SimulatorControl::availableSimulators()) {
QStandardItem *item = new QStandardItem(QString("%1, %2").arg(device.name)
.arg(device.runtimeName));
QVariant v;
v.setValue(device);
item->setData(v);
m_deviceTypeModel.appendRow(item);
}
}
IosDeviceType currentDType = m_runConfiguration->deviceType();
QVariant currentData = m_deviceTypeComboBox->currentData();
if (currentDType.type == IosDeviceType::SimulatedDevice && !currentDType.identifier.isEmpty()
&& (!currentData.isValid()
|| currentDType != toIosDeviceType(currentData.value<SimulatorInfo>())))
{
bool didSet = false;
for (int i = 0; m_deviceTypeModel.hasIndex(i, 0); ++i) {
QVariant vData = m_deviceTypeModel.data(m_deviceTypeModel.index(i, 0), Qt::UserRole + 1);
SimulatorInfo dType = vData.value<SimulatorInfo>();
if (dType.identifier == currentDType.identifier) {
m_deviceTypeComboBox->setCurrentIndex(i);
didSet = true;
break;
}
}
if (!didSet) {
qCWarning(iosLog) << "could not set " << currentDType << " as it is not in model";
}
}
m_executableLineEdit->setText(m_runConfiguration->localExecutable().toUserOutput());
}
// IosRunConfigurationFactory
IosRunConfigurationFactory::IosRunConfigurationFactory()
{
registerRunConfiguration<IosRunConfiguration>("Qt4ProjectManager.IosRunConfiguration:");
addSupportedTargetDeviceType(Constants::IOS_DEVICE_TYPE);
addSupportedTargetDeviceType(Constants::IOS_SIMULATOR_TYPE);
addSupportedProjectType(QmakeProjectManager::Constants::QMAKEPROJECT_ID);
}
} // namespace Internal
} // namespace Ios