From a2efb6f321dd090481d49f0c5759e3a6d6816eb1 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 15 Feb 2013 15:22:01 +0100 Subject: [PATCH] Device support: Remove fallbacks for Creator < 2.6. A grace period of two minor versions seems enough. Change-Id: If29ddae40b0ed70ba6c26a2990e958f2859c03b9 Reviewed-by: Aurindam Jana --- .../devicesupport/devicemanager.cpp | 33 ------------------- .../devicesupport/devicemanager.h | 1 - 2 files changed, 34 deletions(-) diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp index 7af53626996..656e0b05a50 100644 --- a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp @@ -153,10 +153,6 @@ void DeviceManager::load() QList userDevices; if (reader.load(settingsFilePath(QLatin1String("/qtcreator/devices.xml")))) userDevices = fromMap(reader.restoreValues().value(QLatin1String(DeviceManagerKey)).toMap()); - else if (reader.load(settingsFilePath(QLatin1String("/devices.xml")))) - userDevices = fromMap(reader.restoreValues().value(QLatin1String(DeviceManagerKey)).toMap()); - else - userDevices = loadPre2_6(); // Insert devices into the model. Prefer the higher device version when there are multiple // devices with the same id. foreach (IDevice::Ptr device, userDevices) { @@ -176,35 +172,6 @@ void DeviceManager::load() ensureOneDefaultDevicePerType(); } -// TODO: Remove in 2.8 -QList DeviceManager::loadPre2_6() -{ - QList devices; - QSettings *settings = Core::ICore::settings(); - settings->beginGroup(QLatin1String("MaemoDeviceConfigs")); - const QVariantHash defaultDevsHash = settings->value(QLatin1String("DefaultConfigs")).toHash(); - for (QVariantHash::ConstIterator it = defaultDevsHash.constBegin(); - it != defaultDevsHash.constEnd(); ++it) { - d->defaultDevices.insert(Core::Id(it.key()), Core::Id(it.value().toString())); - } - int count = settings->beginReadArray(QLatin1String("ConfigList")); - for (int i = 0; i < count; ++i) { - settings->setArrayIndex(i); - QVariantMap map; - foreach (const QString &key, settings->childKeys()) - map.insert(key, settings->value(key)); - const IDeviceFactory * const factory = restoreFactory(map); - if (!factory) - continue; - IDevice::Ptr device = factory->restore(map); - QTC_ASSERT(device, continue); - devices << device; - } - settings->endArray(); - settings->endGroup(); - return devices; -} - QList DeviceManager::fromMap(const QVariantMap &map) { QList devices; diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.h b/src/plugins/projectexplorer/devicesupport/devicemanager.h index 6950bfb9b37..a57a0e03c36 100644 --- a/src/plugins/projectexplorer/devicesupport/devicemanager.h +++ b/src/plugins/projectexplorer/devicesupport/devicemanager.h @@ -84,7 +84,6 @@ private: DeviceManager(bool isInstance = false); void load(); - QList loadPre2_6(); static const IDeviceFactory *restoreFactory(const QVariantMap &map); QList fromMap(const QVariantMap &map); QVariantMap toMap() const;