From 07df45cdeb0aa9a399aa868d5d5606b9c21362c1 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 30 Jun 2023 12:56:18 +0200 Subject: [PATCH] ProjectExplorer: Remove id/buildkey mangling support for runconfig This was used for qmake and cmake up to Creator 4.11 (Dec 2019). Projects created or touched afterwards are unharmed. Projects created before that and not touched since then will lose runconfigurations. Change-Id: I745aa3641749462a0420df6f658055a78fd52c8e Reviewed-by: Christian Kandeler --- .../projectexplorer/projectconfiguration.cpp | 5 ----- .../projectexplorer/projectconfiguration.h | 2 -- .../projectexplorer/runconfiguration.cpp | 19 ++----------------- 3 files changed, 2 insertions(+), 24 deletions(-) diff --git a/src/plugins/projectexplorer/projectconfiguration.cpp b/src/plugins/projectexplorer/projectconfiguration.cpp index 423ed95479e..8f1158635a9 100644 --- a/src/plugins/projectexplorer/projectconfiguration.cpp +++ b/src/plugins/projectexplorer/projectconfiguration.cpp @@ -43,11 +43,6 @@ Id ProjectConfiguration::id() const return m_id; } -Key ProjectConfiguration::settingsIdKey() -{ - return CONFIGURATION_ID_KEY; -} - void ProjectConfiguration::setDisplayName(const QString &name) { if (m_displayName.setValue(name)) diff --git a/src/plugins/projectexplorer/projectconfiguration.h b/src/plugins/projectexplorer/projectconfiguration.h index 098813c1768..752de036ccd 100644 --- a/src/plugins/projectexplorer/projectconfiguration.h +++ b/src/plugins/projectexplorer/projectconfiguration.h @@ -53,8 +53,6 @@ public: Project *project() const; Kit *kit() const; - static Utils::Key settingsIdKey(); - signals: void displayNameChanged(); void toolTipChanged(); diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index 3c78b37cc44..d9af00a608a 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -311,13 +311,8 @@ void RunConfiguration::toMap(Store &map) const void RunConfiguration::toMapSimple(Store &map) const { ProjectConfiguration::toMap(map); + QTC_CHECK(!m_buildKey.isEmpty()); 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 Utils::Id mangled = id().withSuffix(m_buildKey); - map.insert(settingsIdKey(), mangled.toSetting()); - } } void RunConfiguration::setCommandLineGetter(const CommandLineGetter &cmdGetter) @@ -377,17 +372,7 @@ void RunConfiguration::fromMap(const Store &map) m_customized = m_customized || map.value(CUSTOMIZED_KEY, false).toBool(); m_buildKey = map.value(BUILD_KEY).toString(); - - if (m_buildKey.isEmpty()) { - const Utils::Id mangledId = Utils::Id::fromSetting(map.value(settingsIdKey())); - m_buildKey = mangledId.suffixAfter(id()); - - // Hack for cmake projects 4.10 -> 4.11. - const QString magicSeparator = "///::///"; - const int magicIndex = m_buildKey.indexOf(magicSeparator); - if (magicIndex != -1) - m_buildKey = m_buildKey.mid(magicIndex + magicSeparator.length()); - } + QTC_CHECK(!m_buildKey.isEmpty()); } /*!