Commit fc1a209f authored by Friedemann Kleint's avatar Friedemann Kleint

iOS: Unify translation of iOS-Device.

Change-Id: I01374545ec3882a1dc9b08adccf4632f38438efb
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
Reviewed-by: default avatarFawzi Mohamed <fawzi.mohamed@digia.com>
parent e8a4e9c2
......@@ -76,11 +76,7 @@ void IosDeployStep::ctor()
{
m_transferStatus = NoTransfer;
m_device = ProjectExplorer::DeviceKitInformation::device(target()->kit());
QString devName;
if (!m_device.isNull())
devName = m_device->displayName();
if (devName.isEmpty())
devName = tr("iOS device");
const QString devName = m_device.isNull() ? IosDevice::name() : m_device->displayName();
setDefaultDisplayName(tr("Deploy to %1").arg(devName));
}
......
......@@ -55,9 +55,7 @@ IosDeployStepWidget::~IosDeployStepWidget()
QString IosDeployStepWidget::displayName() const
{
QString deviceName = tr("iOS Device");
if (!m_step->device().isNull())
deviceName = m_step->device()->displayName();
const QString deviceName = m_step->device().isNull() ? IosDevice::name() : m_step->device()->displayName();
return tr("<b>Deploy to %1</b>").arg(deviceName);
}
......
......@@ -84,7 +84,7 @@ IosDevice::IosDevice()
IDevice::Hardware,
Constants::IOS_DEVICE_ID)
{
setDisplayName(QCoreApplication::translate("Ios::Internal::IosDevice", "iOS Device"));
setDisplayName(IosDevice::name());
setDeviceState(DeviceStateUnknown);
}
......@@ -98,7 +98,7 @@ IosDevice::IosDevice(const QString &uid)
IDevice::Hardware,
Core::Id(Constants::IOS_DEVICE_ID).withSuffix(uid))
{
setDisplayName(QCoreApplication::translate("Ios::Internal::IosDevice", "iOS Device"));
setDisplayName(IosDevice::name());
setDeviceState(DeviceStateUnknown);
}
......@@ -182,6 +182,12 @@ QString IosDevice::uniqueDeviceID() const
{
return id().suffixAfter(Core::Id(Constants::IOS_DEVICE_ID));
}
QString IosDevice::name()
{
return QCoreApplication::translate("Ios::Internal::IosDevice", "iOS Device");
}
/*
// add back?
......
......@@ -68,6 +68,9 @@ public:
// add back? currently unused...
//QString cpuArchitecure() const;
//QString productType() const;
static QString name();
protected:
friend class IosDeviceFactory;
friend class Ios::Internal::IosDeviceManager;
......
......@@ -42,9 +42,7 @@ IosDeviceFactory::IosDeviceFactory()
QString IosDeviceFactory::displayNameForId(Core::Id type) const
{
if (type == Constants::IOS_DEVICE_TYPE)
return tr("iOS Device");
return QString();
return type == Constants::IOS_DEVICE_TYPE ? IosDevice::name() : QString();
}
QList<Core::Id> IosDeviceFactory::availableCreationIds() const
......
......@@ -112,11 +112,7 @@ QString IosRunConfiguration::defaultDisplayName()
{
ProjectExplorer::IDevice::ConstPtr dev =
ProjectExplorer::DeviceKitInformation::device(target()->kit());
QString devName;
if (!dev.isNull())
devName = dev->displayName();
if (devName.isEmpty())
devName = tr("iOS device");
const QString devName = dev.isNull() ? IosDevice::name() : dev->displayName();
return tr("Run on %1").arg(devName);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment