forked from qt-creator/qt-creator
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:
@@ -193,7 +193,7 @@ void ProjectStorageUpdater::updateQmlTypes(const QStringList &qmlTypesPaths,
|
|||||||
for (const QString &qmlTypesPath : qmlTypesPaths) {
|
for (const QString &qmlTypesPath : qmlTypesPaths) {
|
||||||
SourceId sourceId = m_pathCache.sourceId(SourcePath{qmlTypesPath});
|
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,
|
FileState state = parseTypeInfo(projectData,
|
||||||
Utils::PathString{qmlTypesPath},
|
Utils::PathString{qmlTypesPath},
|
||||||
|
@@ -872,11 +872,11 @@ TEST_F(ProjectStorageUpdater, UpdateQmlTypesFiles)
|
|||||||
Field(&SynchronizationPackage::updatedFileStatusSourceIds,
|
Field(&SynchronizationPackage::updatedFileStatusSourceIds,
|
||||||
UnorderedElementsAre(qmltypesPathSourceId, qmltypes2PathSourceId)),
|
UnorderedElementsAre(qmltypesPathSourceId, qmltypes2PathSourceId)),
|
||||||
Field(&SynchronizationPackage::projectDatas,
|
Field(&SynchronizationPackage::projectDatas,
|
||||||
UnorderedElementsAre(IsProjectData(SourceId{},
|
UnorderedElementsAre(IsProjectData(qmltypesPathSourceId,
|
||||||
qmltypesPathSourceId,
|
qmltypesPathSourceId,
|
||||||
builtinCppNativeModuleId,
|
builtinCppNativeModuleId,
|
||||||
FileType::QmlTypes),
|
FileType::QmlTypes),
|
||||||
IsProjectData(SourceId{},
|
IsProjectData(qmltypes2PathSourceId,
|
||||||
qmltypes2PathSourceId,
|
qmltypes2PathSourceId,
|
||||||
builtinCppNativeModuleId,
|
builtinCppNativeModuleId,
|
||||||
FileType::QmlTypes))),
|
FileType::QmlTypes))),
|
||||||
@@ -901,7 +901,7 @@ TEST_F(ProjectStorageUpdater, DontUpdateQmlTypesFilesIfUnchanged)
|
|||||||
Field(&SynchronizationPackage::updatedFileStatusSourceIds,
|
Field(&SynchronizationPackage::updatedFileStatusSourceIds,
|
||||||
UnorderedElementsAre(qmltypesPathSourceId)),
|
UnorderedElementsAre(qmltypesPathSourceId)),
|
||||||
Field(&SynchronizationPackage::projectDatas,
|
Field(&SynchronizationPackage::projectDatas,
|
||||||
UnorderedElementsAre(IsProjectData(SourceId{},
|
UnorderedElementsAre(IsProjectData(qmltypesPathSourceId,
|
||||||
qmltypesPathSourceId,
|
qmltypesPathSourceId,
|
||||||
builtinCppNativeModuleId,
|
builtinCppNativeModuleId,
|
||||||
FileType::QmlTypes))),
|
FileType::QmlTypes))),
|
||||||
|
Reference in New Issue
Block a user