From df482e27b7ff959295d3ff090a744634c422d96e Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Mon, 7 Dec 2020 10:46:13 +0100 Subject: [PATCH] McuSupport: Identify kits also by toolchain MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: QTCREATORBUG-25052 Fixes: QTCREATORBUG-25053 Change-Id: I87e51fbdb8d01cb564574f996bdfb51420f28584 Reviewed-by: Dawid Śliwa Reviewed-by: Yoann Lopes Reviewed-by: Alessandro Portale --- src/plugins/mcusupport/mcusupportconstants.h | 1 + src/plugins/mcusupport/mcusupportoptions.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/mcusupport/mcusupportconstants.h b/src/plugins/mcusupport/mcusupportconstants.h index 2e10d0ff332..130d645674a 100644 --- a/src/plugins/mcusupport/mcusupportconstants.h +++ b/src/plugins/mcusupport/mcusupportconstants.h @@ -39,6 +39,7 @@ const char KIT_MCUTARGET_SDKVERSION_KEY[] = "McuSupport.McuTargetSdkVersion"; const char KIT_MCUTARGET_KITVERSION_KEY[] = "McuSupport.McuTargetKitVersion"; const char KIT_MCUTARGET_COLORDEPTH_KEY[] = "McuSupport.McuTargetColorDepth"; const char KIT_MCUTARGET_OS_KEY[] = "McuSupport.McuTargetOs"; +const char KIT_MCUTARGET_TOOCHAIN_KEY[] = "McuSupport.McuTargetToolchain"; const char SETTINGS_GROUP[] = "McuSupport"; const char SETTINGS_KEY_PACKAGE_PREFIX[] = "Package_"; diff --git a/src/plugins/mcusupport/mcusupportoptions.cpp b/src/plugins/mcusupport/mcusupportoptions.cpp index 9de0d0b0b7b..1d4a82e36c4 100644 --- a/src/plugins/mcusupport/mcusupportoptions.cpp +++ b/src/plugins/mcusupport/mcusupportoptions.cpp @@ -65,7 +65,7 @@ using namespace Utils; namespace McuSupport { namespace Internal { -static const int KIT_VERSION = 7; // Bumps up whenever details in Kit creation change +static const int KIT_VERSION = 8; // Bumps up whenever details in Kit creation change static QString packagePathFromSettings(const QString &settingsKey, QSettings::Scope scope = QSettings::UserScope, @@ -581,6 +581,7 @@ static void setKitProperties(const QString &kitName, Kit *k, const McuTarget *mc k->setValue(KIT_MCUTARGET_SDKVERSION_KEY, mcuTarget->qulVersion().toString()); k->setValue(KIT_MCUTARGET_KITVERSION_KEY, KIT_VERSION); k->setValue(KIT_MCUTARGET_OS_KEY, static_cast(mcuTarget->os())); + k->setValue(KIT_MCUTARGET_TOOCHAIN_KEY, mcuTarget->toolChainPackage()->toolChainName()); k->setAutoDetected(true); k->makeSticky(); if (mcuTarget->toolChainPackage()->isDesktopToolchain()) @@ -745,6 +746,8 @@ QList McuSupportOptions::existingKits(const McuTarget *mcuTarget) && kit->value(KIT_MCUTARGET_COLORDEPTH_KEY) == mcuTarget->colorDepth() && kit->value(KIT_MCUTARGET_OS_KEY).toInt() == static_cast(mcuTarget->os()) + && kit->value(KIT_MCUTARGET_TOOCHAIN_KEY) + == mcuTarget->toolChainPackage()->toolChainName() )); }); }