QmlProjectManager: Detect file types correctly

Just calling everything "Source" is not very helpful.

Change-Id: I74a19e46782aa301c5726130200aeb16ef916d78
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Ulf Hermann
2017-11-23 11:41:35 +01:00
parent 3446c0dbd8
commit b2c2c7d642

View File

@@ -353,10 +353,10 @@ void QmlProject::generateProjectTree()
auto newRoot = new Internal::QmlProjectNode(this);
for (const QString &f : m_projectItem.data()->files()) {
FileType fileType = FileType::Source; // ### FIXME
if (f == projectFilePath().toString())
fileType = FileType::Project;
newRoot->addNestedNode(new FileNode(Utils::FileName::fromString(f), fileType, false));
const Utils::FileName fileName = Utils::FileName::fromString(f);
const FileType fileType = (fileName == projectFilePath())
? FileType::Project : FileNode::fileTypeForFileName(fileName);
newRoot->addNestedNode(new FileNode(fileName, fileType, false));
}
newRoot->addNestedNode(new FileNode(projectFilePath(), FileType::Project, false));