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();
|
QMap<QString, Platform> platforms = IosProbe::detectPlatforms();
|
||||||
QMapIterator<QString, Platform> iter(platforms);
|
QMapIterator<QString, Platform> iter(platforms);
|
||||||
Utils::FileName simulatorPath;
|
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);
|
IDevice::ConstPtr dev = devManager->find(devId);
|
||||||
if (!simulatorPath.isEmpty() && simulatorPath.toFileInfo().exists()) {
|
if (!dev.isNull())
|
||||||
if (!dev.isNull()) {
|
return;
|
||||||
if (static_cast<const IosSimulator*>(dev.data())->simulatorPath() == simulatorPath)
|
IosSimulator *newDev = new IosSimulator(devId);
|
||||||
return;
|
devManager->addDevice(IDevice::ConstPtr(newDev));
|
||||||
devManager->removeDevice(devId);
|
|
||||||
}
|
|
||||||
IosSimulator *newDev = new IosSimulator(devId, simulatorPath);
|
|
||||||
devManager->addDevice(IDevice::ConstPtr(newDev));
|
|
||||||
} else if (!dev.isNull()) {
|
|
||||||
devManager->removeDevice(devId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void IosConfigurations::setDeveloperPath(const FileName &devPath)
|
void IosConfigurations::setDeveloperPath(const FileName &devPath)
|
||||||
|
|||||||
@@ -40,14 +40,11 @@ using namespace ProjectExplorer;
|
|||||||
namespace Ios {
|
namespace Ios {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
const char *SIMULATOR_PATH_KEY = "SIMULATOR_PATH";
|
IosSimulator::IosSimulator(Core::Id id)
|
||||||
|
|
||||||
IosSimulator::IosSimulator(Core::Id id, Utils::FileName simulatorPath)
|
|
||||||
: IDevice(Core::Id(Constants::IOS_SIMULATOR_TYPE),
|
: IDevice(Core::Id(Constants::IOS_SIMULATOR_TYPE),
|
||||||
IDevice::AutoDetected,
|
IDevice::AutoDetected,
|
||||||
IDevice::Emulator,
|
IDevice::Emulator,
|
||||||
id),
|
id),
|
||||||
m_simulatorPath(simulatorPath),
|
|
||||||
m_lastPort(Constants::IOS_SIMULATOR_PORT_START)
|
m_lastPort(Constants::IOS_SIMULATOR_PORT_START)
|
||||||
{
|
{
|
||||||
setDisplayName(QCoreApplication::translate("Ios::Internal::IosSimulator", "iOS Simulator"));
|
setDisplayName(QCoreApplication::translate("Ios::Internal::IosSimulator", "iOS Simulator"));
|
||||||
@@ -110,11 +107,6 @@ DeviceProcessSignalOperation::Ptr IosSimulator::signalOperation() const
|
|||||||
return DeviceProcessSignalOperation::Ptr();
|
return DeviceProcessSignalOperation::Ptr();
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FileName IosSimulator::simulatorPath() const
|
|
||||||
{
|
|
||||||
return m_simulatorPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
IDevice::Ptr IosSimulator::clone() const
|
IDevice::Ptr IosSimulator::clone() const
|
||||||
{
|
{
|
||||||
return IDevice::Ptr(new IosSimulator(*this));
|
return IDevice::Ptr(new IosSimulator(*this));
|
||||||
@@ -123,14 +115,11 @@ IDevice::Ptr IosSimulator::clone() const
|
|||||||
void IosSimulator::fromMap(const QVariantMap &map)
|
void IosSimulator::fromMap(const QVariantMap &map)
|
||||||
{
|
{
|
||||||
IDevice::fromMap(map);
|
IDevice::fromMap(map);
|
||||||
m_simulatorPath = Utils::FileName::fromString(map.value(QLatin1String(SIMULATOR_PATH_KEY))
|
|
||||||
.toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariantMap IosSimulator::toMap() const
|
QVariantMap IosSimulator::toMap() const
|
||||||
{
|
{
|
||||||
QVariantMap res = IDevice::toMap();
|
QVariantMap res = IDevice::toMap();
|
||||||
res.insert(QLatin1String(SIMULATOR_PATH_KEY), simulatorPath().toString());
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ public:
|
|||||||
QString displayNameForActionId(Core::Id actionId) const QTC_OVERRIDE;
|
QString displayNameForActionId(Core::Id actionId) const QTC_OVERRIDE;
|
||||||
void executeAction(Core::Id actionId, QWidget *parent = 0) QTC_OVERRIDE;
|
void executeAction(Core::Id actionId, QWidget *parent = 0) QTC_OVERRIDE;
|
||||||
ProjectExplorer::DeviceProcessSignalOperation::Ptr signalOperation() const QTC_OVERRIDE;
|
ProjectExplorer::DeviceProcessSignalOperation::Ptr signalOperation() const QTC_OVERRIDE;
|
||||||
Utils::FileName simulatorPath() const;
|
|
||||||
void fromMap(const QVariantMap &map) QTC_OVERRIDE;
|
void fromMap(const QVariantMap &map) QTC_OVERRIDE;
|
||||||
QVariantMap toMap() const QTC_OVERRIDE;
|
QVariantMap toMap() const QTC_OVERRIDE;
|
||||||
quint16 nextPort() const;
|
quint16 nextPort() const;
|
||||||
@@ -66,10 +65,9 @@ protected:
|
|||||||
friend class IosSimulatorFactory;
|
friend class IosSimulatorFactory;
|
||||||
friend class IosConfigurations;
|
friend class IosConfigurations;
|
||||||
IosSimulator();
|
IosSimulator();
|
||||||
IosSimulator(Core::Id id, Utils::FileName simulatorPath);
|
IosSimulator(Core::Id id);
|
||||||
IosSimulator(const IosSimulator &other);
|
IosSimulator(const IosSimulator &other);
|
||||||
private:
|
private:
|
||||||
Utils::FileName m_simulatorPath;
|
|
||||||
mutable quint16 m_lastPort;
|
mutable quint16 m_lastPort;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user