QmlDesigner: Remove "App" from the Components view

Task-number: QDS-8116
Change-Id: I9f578bf3081c9399eaf12c2f3d0aa3c27151a016
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This commit is contained in:
Samuel Ghinet
2022-10-31 14:03:08 +02:00
parent cbea3f15ce
commit 16dde463ed

View File

@@ -38,6 +38,7 @@ QT_END_NAMESPACE
namespace QmlDesigner {
static const QString s_qmlFilePattern = QStringLiteral("*.qml");
constexpr const char AppFileName[] = "App.qml";
SubComponentManager::SubComponentManager(Model *model,
ExternalDependenciesInterface &externalDependencies)
@@ -232,11 +233,17 @@ void SubComponentManager::parseDirectory(const QString &canonicalDirPath, bool a
QFileInfoList monitoredList = watchedFiles(canonicalDirPath);
QFileInfoList newList;
const QFileInfoList qmlFileList = dir.entryInfoList();
const QString appFilePath = m_filePathDir.absoluteFilePath(AppFileName);
for (const QFileInfo &qmlFile : qmlFileList) {
if (QFileInfo(m_filePath.toLocalFile()) == qmlFile) {
// do not parse main file
continue;
}
if (qmlFile.absoluteFilePath() == appFilePath)
continue;
if (!qmlFile.fileName().at(0).isUpper()) {
// QML sub components must be upper case
continue;