diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2016-12-07 11:12:44 +0100 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2016-12-07 12:14:25 +0000 |
commit | 572396773beb2b21bcfeea5165221170ea033c0c (patch) | |
tree | eb8e0166c188ac26962fb80be94c483ecaa93aae | |
parent | f78dd2be6402bc075cda592f36bedd2b8f7c39df (diff) | |
download | qt-creator-572396773beb2b21bcfeea5165221170ea033c0c.tar.gz |
ios: Fix the default device icons
In 4.2 the IDevice constructors need to set the device icon, and I
missed a few constructors. This should fix it.
This patch will not apply to master, and should be skipped when merging.
Change-Id: I66cf529dfe539a90a753dd15e8f069e1f11e8176
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
-rw-r--r-- | src/plugins/ios/iosdevice.cpp | 16 | ||||
-rw-r--r-- | src/plugins/ios/iossimulator.cpp | 17 |
2 files changed, 25 insertions, 8 deletions
diff --git a/src/plugins/ios/iosdevice.cpp b/src/plugins/ios/iosdevice.cpp index e63c4945af..4351929e12 100644 --- a/src/plugins/ios/iosdevice.cpp +++ b/src/plugins/ios/iosdevice.cpp @@ -79,6 +79,16 @@ static QString CFStringRef2QString(CFStringRef s) namespace Ios { namespace Internal { +static const QList<Utils::Icon>& iosDeviceIcon() +{ + static const QList<Utils::Icon> icon = + {Utils::Icon({{":/ios/images/iosdevicesmall.png", + Utils::Theme::PanelTextColorDark}}, Utils::Icon::Tint), + Utils::Icon({{":/ios/images/iosdevice.png", + Utils::Theme::IconsBaseColor}})}; + return icon; +} + IosDevice::IosDevice() : IDevice(Core::Id(Constants::IOS_DEVICE_TYPE), IDevice::AutoDetected, @@ -92,10 +102,7 @@ IosDevice::IosDevice() ports.addRange(Utils::Port(Constants::IOS_DEVICE_PORT_START), Utils::Port(Constants::IOS_DEVICE_PORT_END)); setFreePorts(ports); - setDeviceIcon({Utils::Icon({{":/ios/images/iosdevicesmall.png", - Utils::Theme::PanelTextColorDark}}, Utils::Icon::Tint), - Utils::Icon({{":/ios/images/iosdevice.png", - Utils::Theme::IconsBaseColor}})}); + setDeviceIcon(iosDeviceIcon()); } IosDevice::IosDevice(const IosDevice &other) @@ -112,6 +119,7 @@ IosDevice::IosDevice(const QString &uid) { setDisplayName(IosDevice::name()); setDeviceState(DeviceDisconnected); + setDeviceIcon(iosDeviceIcon()); } diff --git a/src/plugins/ios/iossimulator.cpp b/src/plugins/ios/iossimulator.cpp index 1ae8caf4f7..c1a086ffb3 100644 --- a/src/plugins/ios/iossimulator.cpp +++ b/src/plugins/ios/iossimulator.cpp @@ -45,6 +45,16 @@ static const QLatin1String iosDeviceTypeDisplayNameKey = QLatin1String("displayN static const QLatin1String iosDeviceTypeTypeKey = QLatin1String("type"); static const QLatin1String iosDeviceTypeIdentifierKey = QLatin1String("identifier"); +static const QList<Utils::Icon>& iosSimulatorIcon() +{ + static const QList<Utils::Icon> icon = + {Utils::Icon({{":/ios/images/iosdevicesmall.png", + Utils::Theme::PanelTextColorDark}}, Utils::Icon::Tint), + Utils::Icon({{":/ios/images/iosdevice.png", + Utils::Theme::IconsBaseColor}})}; + return icon; +} + IosSimulator::IosSimulator(Core::Id id) : IDevice(Core::Id(Constants::IOS_SIMULATOR_TYPE), IDevice::AutoDetected, @@ -54,10 +64,7 @@ IosSimulator::IosSimulator(Core::Id id) { setDisplayName(QCoreApplication::translate("Ios::Internal::IosSimulator", "iOS Simulator")); setDeviceState(DeviceReadyToUse); - setDeviceIcon({Utils::Icon({{":/ios/images/iosdevicesmall.png", - Utils::Theme::PanelTextColorDark}}, Utils::Icon::Tint), - Utils::Icon({{":/ios/images/iosdevice.png", - Utils::Theme::IconsBaseColor}})}); + setDeviceIcon(iosSimulatorIcon()); } IosSimulator::IosSimulator() @@ -69,6 +76,7 @@ IosSimulator::IosSimulator() { setDisplayName(QCoreApplication::translate("Ios::Internal::IosSimulator", "iOS Simulator")); setDeviceState(DeviceReadyToUse); + setDeviceIcon(iosSimulatorIcon()); } IosSimulator::IosSimulator(const IosSimulator &other) @@ -76,6 +84,7 @@ IosSimulator::IosSimulator(const IosSimulator &other) { setDisplayName(QCoreApplication::translate("Ios::Internal::IosSimulator", "iOS Simulator")); setDeviceState(DeviceReadyToUse); + setDeviceIcon(iosSimulatorIcon()); } |