forked from qt-creator/qt-creator
ProjectExplorer: Handle project file list globally
Handle the generation of the list of files in a project globally, based on the project tree. Creator now has the concept of TreeManagers which can enrich the project tree with additional data (e.g. the files found in a resource file), which the project does not necessarily know about. So use that tree to find the files that belong to a project instead of implementing similar features in each project. Change-Id: Ia375a914a1f2c0adaa427f9eda834eec2db07f68 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Marco Benelli <marco.benelli@qt.io>
This commit is contained in:
@@ -306,21 +306,6 @@ QString CMakeProject::displayName() const
|
||||
return root ? root->displayName() : projectDirectory().fileName();
|
||||
}
|
||||
|
||||
QStringList CMakeProject::files(FilesMode fileMode) const
|
||||
{
|
||||
QStringList result;
|
||||
if (ProjectNode *rpn = rootProjectNode()) {
|
||||
rpn->forEachNode([&](const FileNode *fn) {
|
||||
const bool isGenerated = fn->isGenerated();
|
||||
if ((fileMode & Project::SourceFiles) && !isGenerated)
|
||||
result.append(fn->filePath().toString());
|
||||
if ((fileMode & Project::GeneratedFiles) && isGenerated)
|
||||
result.append(fn->filePath().toString());
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Project::RestoreResult CMakeProject::fromMap(const QVariantMap &map, QString *errorMessage)
|
||||
{
|
||||
RestoreResult result = Project::fromMap(map, errorMessage);
|
||||
|
||||
Reference in New Issue
Block a user