aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@qt.io>2021-12-09 17:48:55 +0100
committerMarco Bubke <marco.bubke@qt.io>2021-12-13 17:45:55 +0000
commit6ecd4e76b4d9354984744203be8fb9c0e99a6cfc (patch)
tree58ff811013f8b02f3977a19fb56dce378b71232a
parent08cbf13199d41690d3df3ba6535dc08e56dcb321 (diff)
QmlDesigner: Fix broken tests
There were key conflicts because we do not got all type ids. Change-Id: Ief90920cb02a0e6478ee89f9b54ed8e3158fb3b6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
-rw-r--r--src/plugins/qmldesigner/designercore/projectstorage/projectstorage.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/plugins/qmldesigner/designercore/projectstorage/projectstorage.h b/src/plugins/qmldesigner/designercore/projectstorage/projectstorage.h
index 92b189e862..e77ba16bad 100644
--- a/src/plugins/qmldesigner/designercore/projectstorage/projectstorage.h
+++ b/src/plugins/qmldesigner/designercore/projectstorage/projectstorage.h
@@ -522,6 +522,13 @@ private:
return selectTypeIdsForSourceIdsStatement.template values<TypeId>(128, toIntegers(sourceIds));
}
+ void unique(SourceIds &sourceIds)
+ {
+ std::sort(sourceIds.begin(), sourceIds.end());
+ auto newEnd = std::unique(sourceIds.begin(), sourceIds.end());
+ sourceIds.erase(newEnd, sourceIds.end());
+ }
+
void synchronizeTypes(Storage::Types &types,
TypeIds &updatedTypeIds,
AliasPropertyDeclarations &insertedAliasPropertyDeclarations,
@@ -537,8 +544,8 @@ private:
sourceIdsOfTypes.reserve(updatedSourceIds.size());
SourceIds notUpdatedExportedSourceIds;
notUpdatedExportedSourceIds.reserve(updatedSourceIds.size());
- TypeIds exportedTypeIds;
- exportedTypeIds.reserve(types.size());
+ SourceIds exportedSourceIds;
+ exportedSourceIds.reserve(types.size());
for (auto &&type : types) {
if (!type.sourceId)
@@ -548,19 +555,19 @@ private:
sourceIdsOfTypes.push_back(type.sourceId);
updatedTypeIds.push_back(typeId);
if (type.changeLevel != Storage::ChangeLevel::ExcludeExportedTypes) {
- exportedTypeIds.push_back(typeId);
+ exportedSourceIds.push_back(type.sourceId);
extractExportedTypes(typeId, type, exportedTypes);
}
}
- std::sort(updatedTypeIds.begin(), updatedTypeIds.end());
+ unique(exportedSourceIds);
SourceIds sourceIdsWithoutType = filterSourceIdsWithoutType(updatedSourceIds,
sourceIdsOfTypes);
- TypeIds notUpdatedTypeIds = fetchTypeIds(sourceIdsWithoutType);
- exportedTypeIds.insert(exportedTypeIds.end(),
- notUpdatedTypeIds.begin(),
- notUpdatedTypeIds.end());
+ exportedSourceIds.insert(exportedSourceIds.end(),
+ sourceIdsWithoutType.begin(),
+ sourceIdsWithoutType.end());
+ TypeIds exportedTypeIds = fetchTypeIds(exportedSourceIds);
synchronizeExportedTypes(exportedTypeIds,
exportedTypes,
relinkableAliasPropertyDeclarations,