forked from qt-creator/qt-creator
QtSupport: Remove unusual access pattern to plugin constants
Change-Id: Ifc21607cd9927e99b5c49f1631d8940725a058fd Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -36,9 +36,11 @@
|
||||
#include <texteditor/textdocument.h>
|
||||
|
||||
#include <qmljs/qmljsmodelmanagerinterface.h>
|
||||
|
||||
#include <qmljstools/qmljstoolsconstants.h>
|
||||
|
||||
#include <qtsupport/qtcppkitinfo.h>
|
||||
#include <qtsupport/qtkitaspect.h>
|
||||
#include <qtsupport/qtsupportconstants.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/checkablemessagebox.h>
|
||||
@@ -1017,7 +1019,7 @@ void CMakeBuildSystem::updateProjectData()
|
||||
|
||||
{
|
||||
const bool mergedHeaderPathsAndQmlImportPaths = kit()->value(
|
||||
QtSupport::KitHasMergedHeaderPathsWithQmlImportPaths::id(), false).toBool();
|
||||
QtSupport::Constants::KIT_HAS_MERGED_HEADER_PATHS_WITH_QML_IMPORT_PATHS, false).toBool();
|
||||
QStringList extraHeaderPaths;
|
||||
QList<QByteArray> moduleMappings;
|
||||
for (const RawProjectPart &rpp : std::as_const(rpps)) {
|
||||
@@ -1575,7 +1577,7 @@ void CMakeBuildSystem::updateQmlJSCodeModel(const QStringList &extraHeaderPaths,
|
||||
|
||||
const CMakeConfig &cm = configurationFromCMake();
|
||||
addImports(cm.stringValueOf("QML_IMPORT_PATH"));
|
||||
addImports(kit()->value(QtSupport::KitQmlImportPath::id()).toString());
|
||||
addImports(kit()->value(QtSupport::Constants::KIT_QML_IMPORT_PATH).toString());
|
||||
|
||||
for (const QString &extraHeaderPath : extraHeaderPaths)
|
||||
projectInfo.importPaths.maybeInsert(FilePath::fromString(extraHeaderPath),
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <projectexplorer/toolchain.h>
|
||||
|
||||
#include <qtsupport/qtkitaspect.h>
|
||||
#include <qtsupport/qtsupportconstants.h>
|
||||
#include <qtsupport/qtversionmanager.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
@@ -115,15 +116,15 @@ public:
|
||||
k->makeSticky();
|
||||
if (mcuTarget->toolChainPackage()->isDesktopToolchain())
|
||||
k->setDeviceTypeForIcon(DEVICE_TYPE);
|
||||
k->setValue(QtSupport::SuppliesQtQuickImportPath::id(), true);
|
||||
k->setValue(QtSupport::Constants::FLAGS_SUPPLIES_QTQUICK_IMPORT_PATH, true);
|
||||
// FIXME: This is treated as a pathlist in CMakeBuildSystem::updateQmlJSCodeModel
|
||||
k->setValue(QtSupport::KitQmlImportPath::id(), (sdkPath / "include/qul").toString());
|
||||
k->setValue(QtSupport::KitHasMergedHeaderPathsWithQmlImportPaths::id(), true);
|
||||
k->setValue(QtSupport::Constants::KIT_QML_IMPORT_PATH, (sdkPath / "include/qul").toString());
|
||||
k->setValue(QtSupport::Constants::KIT_HAS_MERGED_HEADER_PATHS_WITH_QML_IMPORT_PATHS, true);
|
||||
QSet<Id> irrelevant = {
|
||||
SysRootKitAspect::id(),
|
||||
QtSupport::SuppliesQtQuickImportPath::id(),
|
||||
QtSupport::KitQmlImportPath::id(),
|
||||
QtSupport::KitHasMergedHeaderPathsWithQmlImportPaths::id(),
|
||||
QtSupport::Constants::FLAGS_SUPPLIES_QTQUICK_IMPORT_PATH,
|
||||
QtSupport::Constants::KIT_QML_IMPORT_PATH,
|
||||
QtSupport::Constants::KIT_HAS_MERGED_HEADER_PATHS_WITH_QML_IMPORT_PATHS,
|
||||
};
|
||||
if (!McuSupportOptions::kitsNeedQtVersion())
|
||||
irrelevant.insert(QtSupport::QtKitAspect::id());
|
||||
@@ -668,7 +669,7 @@ void fixExistingKits(const SettingsHandler::Ptr &settingsHandler)
|
||||
// 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();
|
||||
const Id bringsQtQuickImportPath = QtSupport::Constants::FLAGS_SUPPLIES_QTQUICK_IMPORT_PATH;
|
||||
auto irrelevantAspects = kit->irrelevantAspects();
|
||||
if (!irrelevantAspects.contains(bringsQtQuickImportPath)) {
|
||||
irrelevantAspects.insert(bringsQtQuickImportPath);
|
||||
@@ -679,7 +680,7 @@ void fixExistingKits(const SettingsHandler::Ptr &settingsHandler)
|
||||
}
|
||||
|
||||
// Check if the MCU kit supplies its import path.
|
||||
const auto kitQmlImportPath = QtSupport::KitQmlImportPath::id();
|
||||
const Id kitQmlImportPath = QtSupport::Constants::KIT_QML_IMPORT_PATH;
|
||||
if (!irrelevantAspects.contains(kitQmlImportPath)) {
|
||||
irrelevantAspects.insert(kitQmlImportPath);
|
||||
kit->setIrrelevantAspects(irrelevantAspects);
|
||||
@@ -698,7 +699,7 @@ void fixExistingKits(const SettingsHandler::Ptr &settingsHandler)
|
||||
}
|
||||
|
||||
// Check if the MCU kit has the flag for merged header/qml-import paths set.
|
||||
const auto mergedPaths = QtSupport::KitHasMergedHeaderPathsWithQmlImportPaths::id();
|
||||
const Id mergedPaths = QtSupport::Constants::KIT_HAS_MERGED_HEADER_PATHS_WITH_QML_IMPORT_PATHS;
|
||||
if (!irrelevantAspects.contains(mergedPaths)) {
|
||||
irrelevantAspects.insert(mergedPaths);
|
||||
kit->setIrrelevantAspects(irrelevantAspects);
|
||||
|
||||
@@ -200,7 +200,7 @@ ModelManagerInterface::ProjectInfo ModelManager::defaultProjectInfoForProject(
|
||||
auto v = qtVersion->qtVersion();
|
||||
projectInfo.qmllsPath = ModelManagerInterface::qmllsForBinPath(qtVersion->hostBinPath(), v);
|
||||
projectInfo.qtVersionString = qtVersion->qtVersionString();
|
||||
} else if (!activeKit || !activeKit->value(QtSupport::SuppliesQtQuickImportPath::id(), false).toBool()) {
|
||||
} else if (!activeKit || !activeKit->value(QtSupport::Constants::FLAGS_SUPPLIES_QTQUICK_IMPORT_PATH, false).toBool()) {
|
||||
projectInfo.qtQmlPath = FilePath::fromUserInput(QLibraryInfo::path(QLibraryInfo::Qml2ImportsPath));
|
||||
projectInfo.qmllsPath = ModelManagerInterface::qmllsForBinPath(
|
||||
FilePath::fromUserInput(QLibraryInfo::path(QLibraryInfo::BinariesPath)), QLibraryInfo::version());
|
||||
|
||||
@@ -490,19 +490,4 @@ int QtKitAspectFactory::weight(const Kit *k) const
|
||||
return qtAbi.isCompatibleWith(tcAbi); }) ? 1 : 0;
|
||||
}
|
||||
|
||||
Id SuppliesQtQuickImportPath::id()
|
||||
{
|
||||
return QtSupport::Constants::FLAGS_SUPPLIES_QTQUICK_IMPORT_PATH;
|
||||
}
|
||||
|
||||
Id KitQmlImportPath::id()
|
||||
{
|
||||
return QtSupport::Constants::KIT_QML_IMPORT_PATH;
|
||||
}
|
||||
|
||||
Id KitHasMergedHeaderPathsWithQmlImportPaths::id()
|
||||
{
|
||||
return QtSupport::Constants::KIT_HAS_MERGED_HEADER_PATHS_WITH_QML_IMPORT_PATHS;
|
||||
}
|
||||
|
||||
} // namespace QtSupport
|
||||
|
||||
@@ -29,22 +29,4 @@ public:
|
||||
const QVersionNumber &max = QVersionNumber(INT_MAX, INT_MAX, INT_MAX));
|
||||
};
|
||||
|
||||
class QTSUPPORT_EXPORT SuppliesQtQuickImportPath
|
||||
{
|
||||
public:
|
||||
static Utils::Id id();
|
||||
};
|
||||
|
||||
class QTSUPPORT_EXPORT KitQmlImportPath
|
||||
{
|
||||
public:
|
||||
static Utils::Id id();
|
||||
};
|
||||
|
||||
class QTSUPPORT_EXPORT KitHasMergedHeaderPathsWithQmlImportPaths
|
||||
{
|
||||
public:
|
||||
static Utils::Id id();
|
||||
};
|
||||
|
||||
} // namespace QtSupport
|
||||
|
||||
Reference in New Issue
Block a user