forked from qt-creator/qt-creator
ios: cleanup unused simulator stuff
Change-Id: Id0e877a88bf4bafb44c4be655838253210bcefb3 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
@@ -433,29 +433,11 @@ void IosConfigurations::updateSimulators()
|
||||
QMap<QString, Platform> platforms = IosProbe::detectPlatforms();
|
||||
QMapIterator<QString, Platform> iter(platforms);
|
||||
Utils::FileName simulatorPath;
|
||||
while (iter.hasNext()) {
|
||||
iter.next();
|
||||
const Platform &p = iter.value();
|
||||
if (p.name.startsWith(QLatin1String("iphonesimulator-"))) {
|
||||
simulatorPath = p.platformPath;
|
||||
simulatorPath.appendPath(QLatin1String(
|
||||
"/Developer/Applications/iPhone Simulator.app/Contents/MacOS/iPhone Simulator"));
|
||||
if (simulatorPath.toFileInfo().exists())
|
||||
break;
|
||||
}
|
||||
}
|
||||
IDevice::ConstPtr dev = devManager->find(devId);
|
||||
if (!simulatorPath.isEmpty() && simulatorPath.toFileInfo().exists()) {
|
||||
if (!dev.isNull()) {
|
||||
if (static_cast<const IosSimulator*>(dev.data())->simulatorPath() == simulatorPath)
|
||||
return;
|
||||
devManager->removeDevice(devId);
|
||||
}
|
||||
IosSimulator *newDev = new IosSimulator(devId, simulatorPath);
|
||||
devManager->addDevice(IDevice::ConstPtr(newDev));
|
||||
} else if (!dev.isNull()) {
|
||||
devManager->removeDevice(devId);
|
||||
}
|
||||
if (!dev.isNull())
|
||||
return;
|
||||
IosSimulator *newDev = new IosSimulator(devId);
|
||||
devManager->addDevice(IDevice::ConstPtr(newDev));
|
||||
}
|
||||
|
||||
void IosConfigurations::setDeveloperPath(const FileName &devPath)
|
||||
|
||||
@@ -40,14 +40,11 @@ using namespace ProjectExplorer;
|
||||
namespace Ios {
|
||||
namespace Internal {
|
||||
|
||||
const char *SIMULATOR_PATH_KEY = "SIMULATOR_PATH";
|
||||
|
||||
IosSimulator::IosSimulator(Core::Id id, Utils::FileName simulatorPath)
|
||||
IosSimulator::IosSimulator(Core::Id id)
|
||||
: IDevice(Core::Id(Constants::IOS_SIMULATOR_TYPE),
|
||||
IDevice::AutoDetected,
|
||||
IDevice::Emulator,
|
||||
id),
|
||||
m_simulatorPath(simulatorPath),
|
||||
m_lastPort(Constants::IOS_SIMULATOR_PORT_START)
|
||||
{
|
||||
setDisplayName(QCoreApplication::translate("Ios::Internal::IosSimulator", "iOS Simulator"));
|
||||
@@ -110,11 +107,6 @@ DeviceProcessSignalOperation::Ptr IosSimulator::signalOperation() const
|
||||
return DeviceProcessSignalOperation::Ptr();
|
||||
}
|
||||
|
||||
Utils::FileName IosSimulator::simulatorPath() const
|
||||
{
|
||||
return m_simulatorPath;
|
||||
}
|
||||
|
||||
IDevice::Ptr IosSimulator::clone() const
|
||||
{
|
||||
return IDevice::Ptr(new IosSimulator(*this));
|
||||
@@ -123,14 +115,11 @@ IDevice::Ptr IosSimulator::clone() const
|
||||
void IosSimulator::fromMap(const QVariantMap &map)
|
||||
{
|
||||
IDevice::fromMap(map);
|
||||
m_simulatorPath = Utils::FileName::fromString(map.value(QLatin1String(SIMULATOR_PATH_KEY))
|
||||
.toString());
|
||||
}
|
||||
|
||||
QVariantMap IosSimulator::toMap() const
|
||||
{
|
||||
QVariantMap res = IDevice::toMap();
|
||||
res.insert(QLatin1String(SIMULATOR_PATH_KEY), simulatorPath().toString());
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,6 @@ public:
|
||||
QString displayNameForActionId(Core::Id actionId) const QTC_OVERRIDE;
|
||||
void executeAction(Core::Id actionId, QWidget *parent = 0) QTC_OVERRIDE;
|
||||
ProjectExplorer::DeviceProcessSignalOperation::Ptr signalOperation() const QTC_OVERRIDE;
|
||||
Utils::FileName simulatorPath() const;
|
||||
void fromMap(const QVariantMap &map) QTC_OVERRIDE;
|
||||
QVariantMap toMap() const QTC_OVERRIDE;
|
||||
quint16 nextPort() const;
|
||||
@@ -66,10 +65,9 @@ protected:
|
||||
friend class IosSimulatorFactory;
|
||||
friend class IosConfigurations;
|
||||
IosSimulator();
|
||||
IosSimulator(Core::Id id, Utils::FileName simulatorPath);
|
||||
IosSimulator(Core::Id id);
|
||||
IosSimulator(const IosSimulator &other);
|
||||
private:
|
||||
Utils::FileName m_simulatorPath;
|
||||
mutable quint16 m_lastPort;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user