diff --git a/src/plugins/projectexplorer/settingsaccessor.cpp b/src/plugins/projectexplorer/settingsaccessor.cpp index 19549f9ded41ec59534bd3216a56473d8d41073c..33054f3566ffcf516ecb9663c2cf8f4515504132 100644 --- a/src/plugins/projectexplorer/settingsaccessor.cpp +++ b/src/plugins/projectexplorer/settingsaccessor.cpp @@ -341,7 +341,7 @@ public: QVariantMap update(Project *project, const QVariantMap &map); }; -// Version 10 introduces disabling buildsteps, and handles upgrading custom process steps +// Version 11 introduces kits class Version11Handler : public UserFileVersionHandler { public: @@ -386,6 +386,24 @@ private: QHash<Kit *, QVariantMap> m_targets; }; +// Version 12 reflects the move of environment settings from CMake/Qt4/Custom into +// LocalApplicationRunConfiguration +class Version12Handler : public UserFileVersionHandler +{ +public: + int userFileVersion() const + { + return 12; + } + + QString displayUserFileVersion() const + { + return QLatin1String("2.7pre1"); + } + + QVariantMap update(Project *project, const QVariantMap &map); +}; + } // namespace // @@ -2687,3 +2705,27 @@ void Version11Handler::parseToolChainFile() m_toolChainExtras.insert(id, ToolChainExtraData(mkspec, debugger)); } } + +QVariantMap Version12Handler::update(Project *project, const QVariantMap &map) +{ + QVariantMap result; + QMapIterator<QString, QVariant> it(map); + while (it.hasNext()) { + it.next(); + if (it.value().type() == QVariant::Map) + result.insert(it.key(), update(project, it.value().toMap())); + else if (it.key() == QLatin1String("CMakeProjectManager.CMakeRunConfiguration.UserEnvironmentChanges") + || it.key() == QLatin1String("ProjectExplorer.CustomExecutableRunConfiguration.UserEnvironmentChanges") + || it.key() == QLatin1String("Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges") + || it.key() == QLatin1String("Qt4ProjectManager.MaemoRunConfiguration.UserEnvironmentChanges")) + result.insert(QLatin1String("PE.UserEnvironmentChanges"), it.value()); + else if (it.key() == QLatin1String("CMakeProjectManager.BaseEnvironmentBase") + || it.key() == QLatin1String("ProjectExplorer.CustomExecutableRunConfiguration.BaseEnvironmentBase") + || it.key() == QLatin1String("ProjectExplorer.CustomExecutableRunConfiguration.BaseEnvironmentBase") + || it.key() == QLatin1String("Qt4ProjectManager.MaemoRunConfiguration.BaseEnvironmentBase")) + result.insert(QLatin1String("PE.BaseEnvironmentBase"), it.value()); + else + result.insert(it.key(), it.value()); + } + return result; +}