forked from qt-creator/qt-creator
MCU: Do not add fall-back path for QUL kits
Fixes: UL-3609 Change-Id: I9912c7476f3b45346835d60be61fed7399046162 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
committed by
Erik Verbruggen
parent
12a0934830
commit
7dc82b1af9
@@ -600,7 +600,7 @@ void McuSupportOptions::setQulDir(const FilePath &dir)
|
||||
qtForMCUsSdkPackage->updateStatus();
|
||||
if (qtForMCUsSdkPackage->status() == McuPackage::Status::ValidPackage)
|
||||
Sdk::targetsAndPackages(dir, &packages, &mcuTargets);
|
||||
for (auto package : packages)
|
||||
for (auto package : qAsConst(packages))
|
||||
connect(package, &McuPackage::changed, this, &McuSupportOptions::changed);
|
||||
|
||||
emit changed();
|
||||
@@ -629,7 +629,8 @@ static void setKitProperties(const QString &kitName, Kit *k, const McuTarget *mc
|
||||
k->makeSticky();
|
||||
if (mcuTarget->toolChainPackage()->isDesktopToolchain())
|
||||
k->setDeviceTypeForIcon(DEVICE_TYPE);
|
||||
QSet<Id> irrelevant = { SysRootKitAspect::id() };
|
||||
k->setValue(QtSupport::SuppliesQtQuickImportPath::id(), true);
|
||||
QSet<Id> irrelevant = { SysRootKitAspect::id(), QtSupport::SuppliesQtQuickImportPath::id() };
|
||||
if (!kitNeedsQtVersion())
|
||||
irrelevant.insert(QtSupport::QtKitAspect::id());
|
||||
k->setIrrelevantAspects(irrelevant);
|
||||
@@ -912,5 +913,29 @@ void McuSupportOptions::createAutomaticKits()
|
||||
delete qtForMCUsPackage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Fix/update existing kits if needed
|
||||
*/
|
||||
void McuSupportOptions::fixExistingKits()
|
||||
{
|
||||
for (Kit *kit : KitManager::kits()) {
|
||||
if (!kit->hasValue(Constants::KIT_MCUTARGET_KITVERSION_KEY) )
|
||||
continue;
|
||||
|
||||
// Check if the MCU kits are flagged as supplying a QtQuick import path, in order
|
||||
// to tell the QMLJS code-model that it won't need to add a fall-back import
|
||||
// path.
|
||||
const auto bringsQtQuickImportPath = QtSupport::SuppliesQtQuickImportPath::id();
|
||||
auto irrelevantAspects = kit->irrelevantAspects();
|
||||
if (!irrelevantAspects.contains(bringsQtQuickImportPath)) {
|
||||
irrelevantAspects.insert(bringsQtQuickImportPath);
|
||||
kit->setIrrelevantAspects(irrelevantAspects);
|
||||
}
|
||||
if (!kit->hasValue(bringsQtQuickImportPath)) {
|
||||
kit->setValue(bringsQtQuickImportPath, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // Internal
|
||||
} // McuSupport
|
||||
|
@@ -208,6 +208,7 @@ public:
|
||||
static void removeOutdatedKits();
|
||||
static ProjectExplorer::Kit *newKit(const McuTarget *mcuTarget, const McuPackage *qtForMCUsSdk);
|
||||
static void createAutomaticKits();
|
||||
static void fixExistingKits();
|
||||
void populatePackagesAndTargets();
|
||||
static void registerQchFiles();
|
||||
static void registerExamples();
|
||||
|
@@ -96,6 +96,7 @@ void McuSupportPlugin::extensionsInitialized()
|
||||
connect(KitManager::instance(), &KitManager::kitsLoaded, [](){
|
||||
McuSupportOptions::removeOutdatedKits();
|
||||
McuSupportOptions::createAutomaticKits();
|
||||
McuSupportOptions::fixExistingKits();
|
||||
McuSupportPlugin::askUserAboutMcuSupportKitsSetup();
|
||||
});
|
||||
}
|
||||
|
@@ -155,7 +155,7 @@ ModelManagerInterface::ProjectInfo ModelManager::defaultProjectInfoForProject(
|
||||
projectInfo.tryQmlDump = project && qtVersion->type() == QLatin1String(QtSupport::Constants::DESKTOPQT);
|
||||
projectInfo.qtQmlPath = qtVersion->qmlPath().toFileInfo().canonicalFilePath();
|
||||
projectInfo.qtVersionString = qtVersion->qtVersionString();
|
||||
} else {
|
||||
} else if (!activeKit->value(QtSupport::SuppliesQtQuickImportPath::id(), false).toBool()) {
|
||||
projectInfo.qtQmlPath = QFileInfo(QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath)).canonicalFilePath();
|
||||
projectInfo.qtVersionString = QLatin1String(qVersion());
|
||||
}
|
||||
|
@@ -464,4 +464,9 @@ int QtKitAspect::weight(const Kit *k) const
|
||||
return qtAbi.isCompatibleWith(tcAbi); }) ? 1 : 0;
|
||||
}
|
||||
|
||||
Id SuppliesQtQuickImportPath::id()
|
||||
{
|
||||
return QtSupport::Constants::FLAGS_SUPPLIES_QTQUICK_IMPORT_PATH;
|
||||
}
|
||||
|
||||
} // namespace QtSupport
|
||||
|
@@ -83,4 +83,10 @@ private:
|
||||
void kitsWereLoaded();
|
||||
};
|
||||
|
||||
class QTSUPPORT_EXPORT SuppliesQtQuickImportPath
|
||||
{
|
||||
public:
|
||||
static Utils::Id id();
|
||||
};
|
||||
|
||||
} // namespace QtSupport
|
||||
|
@@ -55,5 +55,8 @@ const char FEATURE_QT_CONSOLE[] = "QtSupport.Wizards.FeatureQtConsole";
|
||||
const char FEATURE_MOBILE[] = "QtSupport.Wizards.FeatureMobile";
|
||||
const char FEATURE_DESKTOP[] = "QtSupport.Wizards.FeatureDesktop";
|
||||
|
||||
// Kit flags
|
||||
const char FLAGS_SUPPLIES_QTQUICK_IMPORT_PATH[] = "QtSupport.SuppliesQtQuickImportPath";
|
||||
|
||||
} // namepsace Constants
|
||||
} // namepsace QtSupport
|
||||
|
Reference in New Issue
Block a user