forked from qt-creator/qt-creator
Make IDeviceFactory use data members
... for display name, icon, and "can create". Also add a convenience function for the special icon setup that's used in all re-implementations. Change-Id: I8332adb38fb4a77b6992007ffe62f861339ba188 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -28,10 +28,6 @@
|
||||
|
||||
#include "iosconstants.h"
|
||||
|
||||
#include <utils/icon.h>
|
||||
|
||||
#include <QIcon>
|
||||
|
||||
namespace Ios {
|
||||
namespace Internal {
|
||||
|
||||
@@ -39,32 +35,9 @@ IosDeviceFactory::IosDeviceFactory()
|
||||
: ProjectExplorer::IDeviceFactory(Constants::IOS_DEVICE_ID)
|
||||
{
|
||||
setObjectName(QLatin1String("IosDeviceFactory"));
|
||||
}
|
||||
|
||||
QString IosDeviceFactory::displayName() const
|
||||
{
|
||||
return IosDevice::name();
|
||||
}
|
||||
|
||||
QIcon IosDeviceFactory::icon() const
|
||||
{
|
||||
using namespace Utils;
|
||||
static const QIcon icon =
|
||||
Icon::combinedIcon({Icon({{":/ios/images/iosdevicesmall.png",
|
||||
Theme::PanelTextColorDark}}, Icon::Tint),
|
||||
Icon({{":/ios/images/iosdevice.png",
|
||||
Theme::IconsBaseColor}})});
|
||||
return icon;
|
||||
}
|
||||
|
||||
bool IosDeviceFactory::canCreate() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ProjectExplorer::IDevice::Ptr IosDeviceFactory::create() const
|
||||
{
|
||||
return ProjectExplorer::IDevice::Ptr();
|
||||
setDisplayName(IosDevice::name());
|
||||
setCombinedIcon(":/ios/images/iosdevicesmall.png",
|
||||
":/ios/images/iosdevice.png");
|
||||
}
|
||||
|
||||
bool IosDeviceFactory::canRestore(const QVariantMap &map) const
|
||||
|
||||
Reference in New Issue
Block a user