summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFawzi Mohamed <fawzi.mohamed@digia.com>2014-03-28 15:25:28 +0100
committerFawzi Mohamed <fawzi.mohamed@digia.com>2014-03-31 13:45:00 +0200
commitbb846398bbc68ec7a50ed78f7143f36438bda24b (patch)
tree2b9a7c3fe230d9353f07620a749b9ef045f7a247
parentdf871df371d45ec1b9eb0bb67f1f49d998f34a97 (diff)
downloadqt-creator-bb846398bbc68ec7a50ed78f7143f36438bda24b.tar.gz
ios: cleanup unused simulator stuff
Change-Id: Id0e877a88bf4bafb44c4be655838253210bcefb3 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
-rw-r--r--src/plugins/ios/iosconfigurations.cpp26
-rw-r--r--src/plugins/ios/iossimulator.cpp13
-rw-r--r--src/plugins/ios/iossimulator.h4
3 files changed, 6 insertions, 37 deletions
diff --git a/src/plugins/ios/iosconfigurations.cpp b/src/plugins/ios/iosconfigurations.cpp
index 1c9883d6e7..3bf3e1b8e6 100644
--- a/src/plugins/ios/iosconfigurations.cpp
+++ b/src/plugins/ios/iosconfigurations.cpp
@@ -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)
diff --git a/src/plugins/ios/iossimulator.cpp b/src/plugins/ios/iossimulator.cpp
index f647438d67..de181ae1a7 100644
--- a/src/plugins/ios/iossimulator.cpp
+++ b/src/plugins/ios/iossimulator.cpp
@@ -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;
}
diff --git a/src/plugins/ios/iossimulator.h b/src/plugins/ios/iossimulator.h
index 0fee860250..29f2a0c1ed 100644
--- a/src/plugins/ios/iossimulator.h
+++ b/src/plugins/ios/iossimulator.h
@@ -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;
};