QmlDesigner: Use qmltypes source id for builtin qmltypes

The builtin qmltypes have no qmldir. So we use the qmltypes source id
as project source id.

Change-Id: Ied9c74e93c1d329f3bdfc7f3a0960d8e7f7b51c5
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Marco Bubke
2022-04-21 12:11:17 +02:00
parent 8b31c4a0ba
commit 5f04711011
2 changed files with 4 additions and 4 deletions

View File

@@ -193,7 +193,7 @@ void ProjectStorageUpdater::updateQmlTypes(const QStringList &qmlTypesPaths,
for (const QString &qmlTypesPath : qmlTypesPaths) {
SourceId sourceId = m_pathCache.sourceId(SourcePath{qmlTypesPath});
Storage::ProjectData projectData{SourceId{}, sourceId, moduleId, Storage::FileType::QmlTypes};
Storage::ProjectData projectData{sourceId, sourceId, moduleId, Storage::FileType::QmlTypes};
FileState state = parseTypeInfo(projectData,
Utils::PathString{qmlTypesPath},

View File

@@ -872,11 +872,11 @@ TEST_F(ProjectStorageUpdater, UpdateQmlTypesFiles)
Field(&SynchronizationPackage::updatedFileStatusSourceIds,
UnorderedElementsAre(qmltypesPathSourceId, qmltypes2PathSourceId)),
Field(&SynchronizationPackage::projectDatas,
UnorderedElementsAre(IsProjectData(SourceId{},
UnorderedElementsAre(IsProjectData(qmltypesPathSourceId,
qmltypesPathSourceId,
builtinCppNativeModuleId,
FileType::QmlTypes),
IsProjectData(SourceId{},
IsProjectData(qmltypes2PathSourceId,
qmltypes2PathSourceId,
builtinCppNativeModuleId,
FileType::QmlTypes))),
@@ -901,7 +901,7 @@ TEST_F(ProjectStorageUpdater, DontUpdateQmlTypesFilesIfUnchanged)
Field(&SynchronizationPackage::updatedFileStatusSourceIds,
UnorderedElementsAre(qmltypesPathSourceId)),
Field(&SynchronizationPackage::projectDatas,
UnorderedElementsAre(IsProjectData(SourceId{},
UnorderedElementsAre(IsProjectData(qmltypesPathSourceId,
qmltypesPathSourceId,
builtinCppNativeModuleId,
FileType::QmlTypes))),