McuSupport: Add SDK version to kit name (and to kit data)

First step towards Qt for MCUs SDK version handling.

Task-number: QTCREATORBUG-23823
Change-Id: I125fe841d9355aa26b4e4701ac9a5fec31987e08
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Alessandro Portale
2020-03-25 15:09:02 +01:00
parent c98f213ae9
commit c1f08cca86
3 changed files with 14 additions and 2 deletions

View File

@@ -34,6 +34,7 @@ const char RUNCONFIGURATION[] = "McuSupport.RunConfiguration";
const char SETTINGS_ID[] = "CC.McuSupport.Configuration"; const char SETTINGS_ID[] = "CC.McuSupport.Configuration";
const char KIT_MCUTARGET_VENDOR_KEY[] = "McuSupport.McuTargetVendor"; const char KIT_MCUTARGET_VENDOR_KEY[] = "McuSupport.McuTargetVendor";
const char KIT_MCUTARGET_MODEL_KEY[] = "McuSupport.McuTargetModel"; const char KIT_MCUTARGET_MODEL_KEY[] = "McuSupport.McuTargetModel";
const char KIT_MCUTARGET_SDKVERSION_KEY[] = "McuSupport.McuTargetSdkVersion";
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

@@ -404,6 +404,12 @@ void McuSupportOptions::deletePackagesAndTargets()
mcuTargets.clear(); mcuTargets.clear();
} }
const QVersionNumber &McuSupportOptions::supportedQulVersion()
{
static const QVersionNumber v({1, 1, 0});
return v;
}
void McuSupportOptions::setQulDir(const Utils::FilePath &dir) void McuSupportOptions::setQulDir(const Utils::FilePath &dir)
{ {
deletePackagesAndTargets(); deletePackagesAndTargets();
@@ -443,6 +449,8 @@ static void setKitProperties(const QString &kitName, ProjectExplorer::Kit *k,
k->setUnexpandedDisplayName(kitName); k->setUnexpandedDisplayName(kitName);
k->setValue(Constants::KIT_MCUTARGET_VENDOR_KEY, mcuTarget->vendor()); k->setValue(Constants::KIT_MCUTARGET_VENDOR_KEY, mcuTarget->vendor());
k->setValue(Constants::KIT_MCUTARGET_MODEL_KEY, mcuTarget->qulPlatform()); k->setValue(Constants::KIT_MCUTARGET_MODEL_KEY, mcuTarget->qulPlatform());
k->setValue(Constants::KIT_MCUTARGET_SDKVERSION_KEY,
McuSupportOptions::supportedQulVersion().toString());
k->setAutoDetected(true); k->setAutoDetected(true);
k->makeSticky(); k->makeSticky();
if (mcuTargetIsDesktop(mcuTarget)) { if (mcuTargetIsDesktop(mcuTarget)) {
@@ -539,8 +547,8 @@ QString McuSupportOptions::kitName(const McuTarget *mcuTarget) const
const QString colorDepth = mcuTarget->colorDepth() > 0 const QString colorDepth = mcuTarget->colorDepth() > 0
? QString::fromLatin1(" %1bpp").arg(mcuTarget->colorDepth()) ? QString::fromLatin1(" %1bpp").arg(mcuTarget->colorDepth())
: ""; : "";
return QString::fromLatin1("Qt for MCUs - %1%2") return QString::fromLatin1("Qt for MCUs %1 - %2%3")
.arg(mcuTarget->qulPlatform(), colorDepth); .arg(supportedQulVersion().toString(), mcuTarget->qulPlatform(), colorDepth);
} }
QList<ProjectExplorer::Kit *> McuSupportOptions::existingKits(const McuTarget *mcuTargt) QList<ProjectExplorer::Kit *> McuSupportOptions::existingKits(const McuTarget *mcuTargt)

View File

@@ -27,6 +27,7 @@
#include <QObject> #include <QObject>
#include <QVector> #include <QVector>
#include <QVersionNumber>
QT_FORWARD_DECLARE_CLASS(QWidget) QT_FORWARD_DECLARE_CLASS(QWidget)
@@ -170,6 +171,8 @@ public:
static void registerQchFiles(); static void registerQchFiles();
static void registerExamples(); static void registerExamples();
static const QVersionNumber &supportedQulVersion();
private: private:
void deletePackagesAndTargets(); void deletePackagesAndTargets();