McuSupport: Do not update paths in kits for different SDK versions

When updating paths for a target in Devices > MCU, the paths were
updated in the corresponding kits for all Qt for MCUs versions.
This would break existing kits made for a different version than
the currently active one.

With this change, only kits made for the same SDK version as the
currently selected target will be modified.

Task-number: UL-6755
Change-Id: I6fda050094b5603914fbbc29a5fc2e83d974a2d6
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Rainer Keller <Rainer.Keller@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Sivert Krøvel
2022-11-03 20:07:29 +01:00
parent 7203d6d44b
commit 6aaf33bee5

View File

@@ -593,6 +593,11 @@ void updatePathsInExistingKits(const SettingsHandler::Ptr &settingsHandler)
for (const auto &target : std::as_const(repo.mcuTargets)) { for (const auto &target : std::as_const(repo.mcuTargets)) {
if (target->isValid()) { if (target->isValid()) {
for (auto *kit : kitsWithMismatchedDependencies(target.get())) { for (auto *kit : kitsWithMismatchedDependencies(target.get())) {
if (kitQulVersion(kit) != target->qulVersion()) {
//Do not update kits made for other Qt for MCUs SDK versions
continue;
}
auto changes = cMakeConfigToMap(CMakeConfigurationKitAspect::configuration(kit)); auto changes = cMakeConfigToMap(CMakeConfigurationKitAspect::configuration(kit));
const auto updateForPackage = [&changes](const McuPackagePtr &package) { const auto updateForPackage = [&changes](const McuPackagePtr &package) {