From ad114983916c319d0e813b9b75657e6139fb81c1 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 12 Aug 2019 12:42:21 +0200 Subject: [PATCH] ProjectExplorer: Persist run config build keys as separate entry The id mangling is not needed by the upper layers anymore, time to get rid of it in the .user files as well. For now, start storing the build keys explicitly, use that directly when present, and fall back to the old mechanism in cases we read settings without it. Change-Id: I1fa467a1488828ffd400e7d67d6fcd8247c938d1 Reviewed-by: Christian Stenger --- src/plugins/projectexplorer/runconfiguration.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index fe9772cb626..056b88459bd 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -62,6 +62,8 @@ using namespace ProjectExplorer::Internal; namespace ProjectExplorer { +const char BUILD_KEY[] = "ProjectExplorer.RunConfiguration.BuildKey"; + /////////////////////////////////////////////////////////////////////// // // ISettingsAspect @@ -316,6 +318,8 @@ QVariantMap RunConfiguration::toMap() const { QVariantMap map = ProjectConfiguration::toMap(); + map.insert(BUILD_KEY, m_buildKey); + // FIXME: Remove this id mangling, e.g. by using a separate entry for the build key. if (!m_buildKey.isEmpty()) { const Core::Id mangled = id().withSuffix(m_buildKey); @@ -345,9 +349,13 @@ bool RunConfiguration::fromMap(const QVariantMap &map) if (!ProjectConfiguration::fromMap(map)) return false; - // FIXME: Remove this id mangling, e.g. by using a separate entry for the build key. - const Core::Id mangledId = Core::Id::fromSetting(map.value(settingsIdKey())); - m_buildKey = mangledId.suffixAfter(id()); + m_buildKey = map.value(BUILD_KEY).toString(); + + if (m_buildKey.isEmpty()) { + // FIXME: Remove this id mangling, e.g. by using a separate entry for the build key. + const Core::Id mangledId = Core::Id::fromSetting(map.value(settingsIdKey())); + m_buildKey = mangledId.suffixAfter(id()); + } return true; }