McuSupport: Identify kits also by toolchain

Fixes: QTCREATORBUG-25052
Fixes: QTCREATORBUG-25053
Change-Id: I87e51fbdb8d01cb564574f996bdfb51420f28584
Reviewed-by: Dawid Śliwa <dawid.sliwa@qt.io>
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Alessandro Portale
2020-12-07 10:46:13 +01:00
parent e6b742a7e1
commit df482e27b7
2 changed files with 5 additions and 1 deletions

View File

@@ -39,6 +39,7 @@ const char KIT_MCUTARGET_SDKVERSION_KEY[] = "McuSupport.McuTargetSdkVersion";
const char KIT_MCUTARGET_KITVERSION_KEY[] = "McuSupport.McuTargetKitVersion"; const char KIT_MCUTARGET_KITVERSION_KEY[] = "McuSupport.McuTargetKitVersion";
const char KIT_MCUTARGET_COLORDEPTH_KEY[] = "McuSupport.McuTargetColorDepth"; const char KIT_MCUTARGET_COLORDEPTH_KEY[] = "McuSupport.McuTargetColorDepth";
const char KIT_MCUTARGET_OS_KEY[] = "McuSupport.McuTargetOs"; const char KIT_MCUTARGET_OS_KEY[] = "McuSupport.McuTargetOs";
const char KIT_MCUTARGET_TOOCHAIN_KEY[] = "McuSupport.McuTargetToolchain";
const char SETTINGS_GROUP[] = "McuSupport"; const char SETTINGS_GROUP[] = "McuSupport";
const char SETTINGS_KEY_PACKAGE_PREFIX[] = "Package_"; const char SETTINGS_KEY_PACKAGE_PREFIX[] = "Package_";

View File

@@ -65,7 +65,7 @@ using namespace Utils;
namespace McuSupport { namespace McuSupport {
namespace Internal { 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, static QString packagePathFromSettings(const QString &settingsKey,
QSettings::Scope scope = QSettings::UserScope, 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_SDKVERSION_KEY, mcuTarget->qulVersion().toString());
k->setValue(KIT_MCUTARGET_KITVERSION_KEY, KIT_VERSION); k->setValue(KIT_MCUTARGET_KITVERSION_KEY, KIT_VERSION);
k->setValue(KIT_MCUTARGET_OS_KEY, static_cast<int>(mcuTarget->os())); k->setValue(KIT_MCUTARGET_OS_KEY, static_cast<int>(mcuTarget->os()));
k->setValue(KIT_MCUTARGET_TOOCHAIN_KEY, mcuTarget->toolChainPackage()->toolChainName());
k->setAutoDetected(true); k->setAutoDetected(true);
k->makeSticky(); k->makeSticky();
if (mcuTarget->toolChainPackage()->isDesktopToolchain()) if (mcuTarget->toolChainPackage()->isDesktopToolchain())
@@ -745,6 +746,8 @@ QList<Kit *> McuSupportOptions::existingKits(const McuTarget *mcuTarget)
&& kit->value(KIT_MCUTARGET_COLORDEPTH_KEY) == mcuTarget->colorDepth() && kit->value(KIT_MCUTARGET_COLORDEPTH_KEY) == mcuTarget->colorDepth()
&& kit->value(KIT_MCUTARGET_OS_KEY).toInt() && kit->value(KIT_MCUTARGET_OS_KEY).toInt()
== static_cast<int>(mcuTarget->os()) == static_cast<int>(mcuTarget->os())
&& kit->value(KIT_MCUTARGET_TOOCHAIN_KEY)
== mcuTarget->toolChainPackage()->toolChainName()
)); ));
}); });
} }