From 5f04711011f84a282febc555fad5305c3d7e1a0a Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Thu, 21 Apr 2022 12:11:17 +0200 Subject: [PATCH] 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 --- .../designercore/projectstorage/projectstorageupdater.cpp | 2 +- tests/unit/unittest/projectstorageupdater-test.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/qmldesigner/designercore/projectstorage/projectstorageupdater.cpp b/src/plugins/qmldesigner/designercore/projectstorage/projectstorageupdater.cpp index 7fb1a140e00..4ba5ffdc620 100644 --- a/src/plugins/qmldesigner/designercore/projectstorage/projectstorageupdater.cpp +++ b/src/plugins/qmldesigner/designercore/projectstorage/projectstorageupdater.cpp @@ -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}, diff --git a/tests/unit/unittest/projectstorageupdater-test.cpp b/tests/unit/unittest/projectstorageupdater-test.cpp index 0f5b27dad73..7a24c47b381 100644 --- a/tests/unit/unittest/projectstorageupdater-test.cpp +++ b/tests/unit/unittest/projectstorageupdater-test.cpp @@ -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))),