CMakePM: Hide QML clutter project files

Hide some of the QML files that we not marked as generated by the Qt QML
CMake code

Fixes: QTCREATORBUG-29631
Change-Id: I01fb571c0c3ff7d8a3861ddaaf7c6d6817c8cc51
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Cristian Adam
2024-04-18 14:29:48 +02:00
parent c3c37b1062
commit c0dfb3ce57

View File

@@ -684,6 +684,22 @@ static void addCompileGroups(ProjectNode *targetRoot,
if (isPchFile(buildDirectory, sourcePath) || isUnityFile(buildDirectory, sourcePath))
node->setIsGenerated(true);
// Hide some of the QML files that we not marked as generated by the Qt QML CMake code
const bool buildDirQmldirOrRcc = sourcePath.isChildOf(buildDirectory)
&& (sourcePath.parentDir().fileName() == ".rcc"
|| sourcePath.fileName() == "qmldir");
const bool otherDirQmldirOrMetatypes = !sourcePath.isChildOf(buildDirectory)
&& !sourcePath.isChildOf(sourceDirectory)
&& (sourcePath.parentDir().fileName() == "metatypes"
|| sourcePath.fileName() == "qmldir");
const bool buildDirPluginCpp = sourcePath.isChildOf(buildDirectory)
&& td.type.endsWith("_LIBRARY")
&& sourcePath.fileName().startsWith(td.name)
&& sourcePath.fileName().endsWith("Plugin.cpp");
if (buildDirQmldirOrRcc || otherDirQmldirOrMetatypes || buildDirPluginCpp)
node->setIsGenerated(true);
const bool showSourceFolders = settings().showSourceSubFolders()
&& sourcesOrHeadersFolder(td.sourceGroups[si.sourceGroup]);