bool BuildConfiguration::fromMap(const QVariantMap &map) { m_clearSystemEnvironment = map.value(QLatin1String(CLEAR_SYSTEM_ENVIRONMENT_KEY)).toBool(); m_userEnvironmentChanges = Utils::EnvironmentItem::fromStringList(map.value(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY)).toStringList()); m_buildDirectory = Utils::FileName::fromString(map.value(QLatin1String(BUILDDIRECTORY_KEY)).toString()); updateCacheAndEmitEnvironmentChanged(); qDeleteAll(m_stepLists); m_stepLists.clear(); int maxI = map.value(QLatin1String(BUILD_STEP_LIST_COUNT), 0).toInt(); for (int i = 0; i < maxI; ++i) { QVariantMap data = map.value(QLatin1String(BUILD_STEP_LIST_PREFIX) + QString::number(i)).toMap(); if (data.isEmpty()) { qWarning() << "No data for build step list" << i << "found!"; continue; } auto list = new BuildStepList(this, idFromMap(data)); if (!list->fromMap(data)) { qWarning() << "Failed to restore build step list" << i; delete list; return false; } m_stepLists.append(list); } // We currently assume there to be at least a clean and build list! QTC_CHECK(knownStepLists().contains(Core::Id(Constants::BUILDSTEPS_BUILD))); QTC_CHECK(knownStepLists().contains(Core::Id(Constants::BUILDSTEPS_CLEAN))); return ProjectConfiguration::fromMap(map); }
BuildStep *WinRtDeployStepFactory::restore(BuildStepList *parent, const QVariantMap &map) { BuildStep *bs = create(parent, idFromMap(map)); if (!bs->fromMap(map)) { delete bs; bs = 0; } return bs; }
BuildStep *MaemoDeployStepFactory::restore(BuildStepList *parent, const QVariantMap &map) { Q_ASSERT(canRestore(parent, map)); BuildStep * const step = create(parent, idFromMap(map)); if (!step->fromMap(map)) { delete step; return 0; } return step; }
DeployConfiguration *WinRtDeployConfigurationFactory::restore(Target *parent, const QVariantMap &map) { WinRtDeployConfiguration *dc = new WinRtDeployConfiguration(parent, idFromMap(map)); if (!dc->fromMap(map)) { delete dc; return 0; } return dc; }
DeployConfiguration *IosDeployConfigurationFactory::restore(Target *parent, const QVariantMap &map) { if (!canRestore(parent, map)) return 0; IosDeployConfiguration *dc = new IosDeployConfiguration(parent, idFromMap(map)); if (dc->fromMap(map)) return dc; delete dc; return 0; }
DeployConfiguration *RemoteLinuxDeployConfigurationFactory::restore(Target *parent, const QVariantMap &map) { if (!canRestore(parent, map)) return 0; QString id = idFromMap(map); RemoteLinuxDeployConfiguration * const dc = new RemoteLinuxDeployConfiguration(parent, id, genericLinuxDisplayName(), QLatin1String(Constants::GenericLinuxOsType)); if (!dc->fromMap(map)) { delete dc; return 0; } return dc; }
DeployConfiguration *RemoteLinuxDeployConfigurationFactory::restore(Target *parent, const QVariantMap &map) { if (!canRestore(parent, map)) return 0; Core::Id id = idFromMap(map); RemoteLinuxDeployConfiguration * const dc = new RemoteLinuxDeployConfiguration(parent, id, genericLinuxDisplayName()); if (!dc->fromMap(map)) { delete dc; return 0; } return dc; }
// Used by the ToolChainManager to restore user-generated ToolChains bool Internal::GccToolChainFactory::canRestore(const QVariantMap &data) { return idFromMap(data).startsWith(QLatin1String(Constants::GCC_TOOLCHAIN_ID) + QLatin1Char(':')); }
bool WinRtDeployConfigurationFactory::canRestore(Target *parent, const QVariantMap &map) const { return canCreate(parent, idFromMap(map)); }
bool GenericRemoteLinuxDeployStepFactory::canRestore(BuildStepList *parent, const QVariantMap &map) const { return canCreate(parent, idFromMap(map)); }
bool OpenOcdGdbServerProviderFactory::canRestore(const QVariantMap &data) { const QString id = idFromMap(data); return id.startsWith(QLatin1String(Constants::OPENOCD_PROVIDER_ID) + QLatin1Char(':')); }
bool WinCEToolChainFactory::canRestore(const QVariantMap &data) { return idFromMap(data).startsWith(QLatin1String(Constants::WINCE_TOOLCHAIN_ID) + QLatin1Char(':')); }
bool DefaultGdbServerProviderFactory::canRestore(const QVariantMap &data) { const auto id = idFromMap(data); return id.startsWith(QLatin1String(Constants::DEFAULT_PROVIDER_ID) + QLatin1Char(':')); }
bool AndroidToolChainFactory::canRestore(const QVariantMap &data) { return idFromMap(data).startsWith(QLatin1String(Constants::ANDROID_TOOLCHAIN_ID) + QLatin1Char(':')); }
bool AndroidPackageInstallationFactory::canRestore(BuildStepList *parent, const QVariantMap &map) const { return canCreate(parent, idFromMap(map)); }
bool MaemoDeployStepFactory::canRestore(BuildStepList *parent, const QVariantMap &map) const { return canCreate(parent, idFromMap(map)) || idFromMap(map) == OldMaemoDeployStepId; }
bool RvctToolChainFactory::canRestore(const QVariantMap &data) { return idFromMap(data).startsWith(QLatin1String(Constants::RVCT_TOOLCHAIN_ID)); }
bool AndroidDeployStepFactory::canRestore(BuildStepList *parent, const QVariantMap &map) const { return canCreate(parent, idFromMap(map)); }
bool CrossLinuxToolChain32BitFactory::canRestore(const QVariantMap &data) { return idFromMap(data).startsWith(QLatin1String(Constants::CROSSLINUX_TOOLCHAIN_32BIT_ID)); }