QmlDesigner: Add more checks for kit when adding import paths

Especially if developing we do not want to parse all kits to slow down
startup time.

Change-Id: If49624941b611b7e8b19864bdd3f31b884c04514
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Thomas Hartmann
2023-04-05 19:37:59 +02:00
parent 22f08280f5
commit 9ac4cd4e4a

View File

@@ -651,9 +651,11 @@ bool StudioWelcomePlugin::delayedInitialize()
const QList<Kit *> kits = Utils::filtered(KitManager::kits(), [](const Kit *k) {
const QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(k);
const bool isQt6 = version && version->qtVersion().majorVersion() == 6;
const bool valid = version && version->isValid();
const bool isQt6 = valid && version->qtVersion().majorVersion() == 6;
const bool autoDetected = valid && version->isAutodetected();
return isQt6
return isQt6 && autoDetected
&& ProjectExplorer::DeviceTypeKitAspect::deviceTypeId(k)
== ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE;
});