forked from qt-creator/qt-creator
McuSupport: Ignore resetting QtMCUs package on target update
QtMCUs package is part of every target with the same pointer address across all targets, when reseting the target packages to default this will cause inconsistensy as the default path for QtMCUs package is the home directory. Fixes: QTCREATORBUG-29960 Change-Id: I2fcc6b631355928bc883e9072b0f3f3c12737c37 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Karim Abdelrahman <karim.abdelrahman@qt.io>
This commit is contained in:
@@ -30,7 +30,6 @@
|
|||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
|
|
||||||
#include <QCoreApplication>
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
@@ -433,7 +432,7 @@ QList<Kit *> existingKits(const McuTarget *mcuTarget)
|
|||||||
using namespace Constants;
|
using namespace Constants;
|
||||||
// some models have compatible name changes that refere to the same supported board across versions.
|
// some models have compatible name changes that refere to the same supported board across versions.
|
||||||
// name changes are tracked here to recognize the corresponding kits as upgradable.
|
// name changes are tracked here to recognize the corresponding kits as upgradable.
|
||||||
static QMap<QString, QStringList> upgradable_to = {
|
static const QMap<QString, QStringList> upgradable_to = {
|
||||||
{"MIMXRT1170-EVK-FREERTOS", {"MIMXRT1170-EVKB-FREERTOS"}}};
|
{"MIMXRT1170-EVK-FREERTOS", {"MIMXRT1170-EVKB-FREERTOS"}}};
|
||||||
return Utils::filtered(KitManager::kits(), [mcuTarget](Kit *kit) {
|
return Utils::filtered(KitManager::kits(), [mcuTarget](Kit *kit) {
|
||||||
return kit->value(KIT_MCUTARGET_KITVERSION_KEY) == KIT_VERSION
|
return kit->value(KIT_MCUTARGET_KITVERSION_KEY) == KIT_VERSION
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
#include "mcusupport_global.h"
|
#include "mcusupport_global.h"
|
||||||
#include "mcusupportplugin.h"
|
#include "mcusupportplugin.h"
|
||||||
#include "mcusupporttr.h"
|
#include "mcusupporttr.h"
|
||||||
|
#include "mcusupportconstants.h"
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
|
|
||||||
@@ -115,12 +116,13 @@ void McuTarget::handlePackageProblems(MessagesList &messages) const
|
|||||||
|
|
||||||
void McuTarget::resetInvalidPathsToDefault()
|
void McuTarget::resetInvalidPathsToDefault()
|
||||||
{
|
{
|
||||||
|
|
||||||
for (McuPackagePtr package : std::as_const(m_packages)) {
|
for (McuPackagePtr package : std::as_const(m_packages)) {
|
||||||
if (!package)
|
if (!package)
|
||||||
continue;
|
continue;
|
||||||
if (package->isValidStatus())
|
if (package->isValidStatus())
|
||||||
continue;
|
continue;
|
||||||
|
if (package->settingsKey() == Constants::SETTINGS_KEY_PACKAGE_QT_FOR_MCUS_SDK)
|
||||||
|
continue;
|
||||||
package->setPath(package->defaultPath());
|
package->setPath(package->defaultPath());
|
||||||
package->writeToSettings();
|
package->writeToSettings();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user