diff options
Diffstat (limited to 'src')
20 files changed, 50 insertions, 59 deletions
diff --git a/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp b/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp index a4f0b40433..5f7f4229c2 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp +++ b/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp @@ -211,8 +211,8 @@ void AutotoolsProject::makefileParsingFinished() auto newRoot = std::make_unique<AutotoolsProjectNode>(projectDirectory()); for (const QString &f : m_files) { const Utils::FileName path = Utils::FileName::fromString(f); - newRoot->addNestedNode(std::make_unique<FileNode>(path, FileNode::fileTypeForFileName(path), - false)); + newRoot->addNestedNode(std::make_unique<FileNode>(path, + FileNode::fileTypeForFileName(path))); } setRootProjectNode(std::move(newRoot)); diff --git a/src/plugins/cmakeprojectmanager/cmakecbpparser.cpp b/src/plugins/cmakeprojectmanager/cmakecbpparser.cpp index e5344df26f..c83c297ce6 100644 --- a/src/plugins/cmakeprojectmanager/cmakecbpparser.cpp +++ b/src/plugins/cmakeprojectmanager/cmakecbpparser.cpp @@ -429,7 +429,7 @@ void CMakeCbpParser::parseUnit() // Now check whether we found a virtual element beneath if (m_parsingCMakeUnit) { m_cmakeFileList.emplace_back( - std::make_unique<FileNode>(fileName, FileType::Project, false)); + std::make_unique<FileNode>(fileName, FileType::Project)); } else { bool generated = false; QString onlyFileName = fileName.fileName(); @@ -440,13 +440,12 @@ void CMakeCbpParser::parseUnit() if (fileName.endsWith(".qrc")) { m_fileList.emplace_back( - std::make_unique<FileNode>(fileName, FileType::Resource, - generated)); + std::make_unique<FileNode>(fileName, FileType::Resource)); } else { m_fileList.emplace_back( - std::make_unique<FileNode>(fileName, FileType::Source, - generated)); + std::make_unique<FileNode>(fileName, FileType::Source)); } + m_fileList.back()->setIsGenerated(generated); } m_unitTargetMap.insert(fileName, m_unitTargets); m_processedUnits.insert(fileName); diff --git a/src/plugins/cmakeprojectmanager/servermodereader.cpp b/src/plugins/cmakeprojectmanager/servermodereader.cpp index 9b293d0ff8..2578f8a759 100644 --- a/src/plugins/cmakeprojectmanager/servermodereader.cpp +++ b/src/plugins/cmakeprojectmanager/servermodereader.cpp @@ -702,7 +702,8 @@ void ServerModeReader::extractCMakeInputsData(const QVariantMap &data) // Always include CMakeLists.txt files, even when cmake things these are part of its // stuff. This unbreaks cmake binaries running from their own build directory. m_cmakeInputsFileNodes.emplace_back( - std::make_unique<FileNode>(sfn, FileType::Project, isTemporary)); + std::make_unique<FileNode>(sfn, FileType::Project)); + m_cmakeInputsFileNodes.back()->setIsGenerated(isTemporary); } } } @@ -908,8 +909,8 @@ void ServerModeReader::addFileGroups(ProjectNode *targetRoot, std::vector<std::unique_ptr<FileNode>> newFileNodes = Utils::transform<std::vector>(newSources, [f, &knownHeaderNodes](const Utils::FileName &fn) { - auto node - = std::make_unique<FileNode>(fn, Node::fileTypeForFileName(fn), f->isGenerated); + auto node = std::make_unique<FileNode>(fn, Node::fileTypeForFileName(fn)); + node->setIsGenerated(f->isGenerated); if (node->fileType() == FileType::Header) knownHeaderNodes.append(node.get()); return node; diff --git a/src/plugins/cmakeprojectmanager/tealeafreader.cpp b/src/plugins/cmakeprojectmanager/tealeafreader.cpp index 320b470e45..8b83e2797b 100644 --- a/src/plugins/cmakeprojectmanager/tealeafreader.cpp +++ b/src/plugins/cmakeprojectmanager/tealeafreader.cpp @@ -422,7 +422,7 @@ void TeaLeafReader::extractData() resetData(); m_projectName = m_parameters.projectName; - m_files.emplace_back(std::make_unique<FileNode>(topCMake, FileType::Project, false)); + m_files.emplace_back(std::make_unique<FileNode>(topCMake, FileType::Project)); // Do not insert topCMake into m_cmakeFiles: The project already watches that! // Find cbp file @@ -458,7 +458,7 @@ void TeaLeafReader::extractData() if (!contains(m_files, [topCMake](const std::unique_ptr<FileNode> &fn) { return fn->filePath() == topCMake; })) - m_files.emplace_back(std::make_unique<FileNode>(topCMake, FileType::Project, false)); + m_files.emplace_back(std::make_unique<FileNode>(topCMake, FileType::Project)); m_buildTargets = cbpparser.buildTargets(); } diff --git a/src/plugins/cmakeprojectmanager/treescanner.cpp b/src/plugins/cmakeprojectmanager/treescanner.cpp index 7a25e9e266..b1719b49e6 100644 --- a/src/plugins/cmakeprojectmanager/treescanner.cpp +++ b/src/plugins/cmakeprojectmanager/treescanner.cpp @@ -166,7 +166,7 @@ void TreeScanner::scanForFiles(FutureInterface *fi, const Utils::FileName& direc if (factory) type = factory(mimeType, fn); - return new FileNode(fn, type, false); + return new FileNode(fn, type); }, fip.get()); Utils::sort(nodes, ProjectExplorer::Node::sortByPath); diff --git a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp index f29749a210..acae72ff4b 100644 --- a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp +++ b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp @@ -300,8 +300,7 @@ void createTree(FolderNode *root, FolderNode *parentNode = createFoldersIfNeeded(root, fileName.parentDir()); if (!parentNode->fileNode(fileName)) { parentNode->addNode(std::make_unique<FileNode>(fileName, - fileTypeForName(fileName.fileName()), - false)); + fileTypeForName(fileName.fileName()))); } } } @@ -395,10 +394,7 @@ void CompilationDatabaseProject::buildTreeAndProjectParts(const Utils::FileName createTree(root.get(), commonPath, rpps); - root->addNode(std::make_unique<FileNode>( - projectFile, - FileType::Project, - false)); + root->addNode(std::make_unique<FileNode>(projectFile, FileType::Project)); setRootProjectNode(std::move(root)); diff --git a/src/plugins/genericprojectmanager/genericproject.cpp b/src/plugins/genericprojectmanager/genericproject.cpp index 3162fecd8e..ebc53187f9 100644 --- a/src/plugins/genericprojectmanager/genericproject.cpp +++ b/src/plugins/genericprojectmanager/genericproject.cpp @@ -396,25 +396,19 @@ void GenericProject::refresh(RefreshOptions options) FileType fileType = FileType::Source; // ### FIXME if (f.endsWith(".qrc")) fileType = FileType::Resource; - newRoot->addNestedNode(std::make_unique<FileNode>(FileName::fromString(f), fileType, - false)); + newRoot->addNestedNode(std::make_unique<FileNode>(FileName::fromString(f), fileType)); } newRoot->addNestedNode(std::make_unique<FileNode>(FileName::fromString(m_filesFileName), - FileType::Project, - /* generated = */ false)); + FileType::Project)); newRoot->addNestedNode(std::make_unique<FileNode>(FileName::fromString(m_includesFileName), - FileType::Project, - /* generated = */ false)); + FileType::Project)); newRoot->addNestedNode(std::make_unique<FileNode>(FileName::fromString(m_configFileName), - FileType::Project, - /* generated = */ false)); + FileType::Project)); newRoot->addNestedNode(std::make_unique<FileNode>(FileName::fromString(m_cxxflagsFileName), - FileType::Project, - /* generated = */ false)); + FileType::Project)); newRoot->addNestedNode(std::make_unique<FileNode>(FileName::fromString(m_cflagsFileName), - FileType::Project, - /* generated = */ false)); + FileType::Project)); setRootProjectNode(std::move(newRoot)); } diff --git a/src/plugins/nim/project/nimproject.cpp b/src/plugins/nim/project/nimproject.cpp index f5e61c611b..9b2a147073 100644 --- a/src/plugins/nim/project/nimproject.cpp +++ b/src/plugins/nim/project/nimproject.cpp @@ -126,7 +126,7 @@ void NimProject::collectProjectFiles() || fileName.endsWith(".nimproject", HostOsInfo::fileNameCaseSensitivity()) || fileName.contains(".nimproject.user", HostOsInfo::fileNameCaseSensitivity())) return nullptr; - return new FileNode(fn, FileType::Source, false); + return new FileNode(fn, FileType::Source); }); }); m_futureWatcher.setFuture(future); diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index 94484f3493..a030d9b2f3 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -733,7 +733,7 @@ bool Project::isKnownFile(const Utils::FileName &filename) const { if (d->m_sortedNodeList.empty()) return filename == projectFilePath(); - const FileNode element(filename, FileType::Unknown, false); + const FileNode element(filename, FileType::Unknown); return std::binary_search(std::begin(d->m_sortedNodeList), std::end(d->m_sortedNodeList), &element, nodeLessThan); } @@ -1062,9 +1062,10 @@ std::unique_ptr<ProjectNode> createFileTree(Project *project) { std::unique_ptr<ProjectNode> root = std::make_unique<TestProjectNode>(project->projectDirectory()); std::vector<std::unique_ptr<FileNode>> nodes; - nodes.emplace_back(std::make_unique<FileNode>(TEST_PROJECT_PATH, FileType::Project, false)); - nodes.emplace_back(std::make_unique<FileNode>(TEST_PROJECT_CPP_FILE, FileType::Source, false)); - nodes.emplace_back(std::make_unique<FileNode>(TEST_PROJECT_GENERATED_FILE, FileType::Source, true)); + nodes.emplace_back(std::make_unique<FileNode>(TEST_PROJECT_PATH, FileType::Project)); + nodes.emplace_back(std::make_unique<FileNode>(TEST_PROJECT_CPP_FILE, FileType::Source)); + nodes.emplace_back(std::make_unique<FileNode>(TEST_PROJECT_GENERATED_FILE, FileType::Source)); + nodes.back()->setIsGenerated(true); root->addNestedNodes(std::move(nodes)); return root; diff --git a/src/plugins/projectexplorer/projectmodels.cpp b/src/plugins/projectexplorer/projectmodels.cpp index 46c98d164b..289d913bb0 100644 --- a/src/plugins/projectexplorer/projectmodels.cpp +++ b/src/plugins/projectexplorer/projectmodels.cpp @@ -261,7 +261,7 @@ void FlatModel::addOrRebuildProjectModel(Project *project) if (container->childCount() == 0) { auto projectFileNode = std::make_unique<FileNode>(project->projectFilePath(), - FileType::Project, false); + FileType::Project); seen.insert(projectFileNode.get()); container->appendChild(new WrapperNode(projectFileNode.get())); project->containerNode()->addNestedNode(std::move(projectFileNode)); diff --git a/src/plugins/projectexplorer/projectnodes.cpp b/src/plugins/projectexplorer/projectnodes.cpp index add3e10878..536e8c27c8 100644 --- a/src/plugins/projectexplorer/projectnodes.cpp +++ b/src/plugins/projectexplorer/projectnodes.cpp @@ -315,13 +315,12 @@ FileType Node::fileTypeForFileName(const Utils::FileName &file) \sa ProjectExplorer::FolderNode, ProjectExplorer::ProjectNode */ -FileNode::FileNode(const Utils::FileName &filePath, const FileType fileType, bool generated, +FileNode::FileNode(const Utils::FileName &filePath, const FileType fileType, int line, const QByteArray &id) : Node(NodeType::File, filePath, line, id), m_fileType(fileType) { setListInProject(true); - setIsGenerated(generated); if (fileType == FileType::Project) setPriority(DefaultProjectFilePriority); else @@ -330,7 +329,8 @@ FileNode::FileNode(const Utils::FileName &filePath, const FileType fileType, boo FileNode *FileNode::clone() const { - auto fn = new FileNode(filePath(), fileType(), isGenerated(), line(), id()); + auto fn = new FileNode(filePath(), fileType(), line(), id()); + fn->setIsGenerated(isGenerated()); fn->setEnabled(isEnabled()); fn->setPriority(priority()); fn->setListInProject(listInProject()); diff --git a/src/plugins/projectexplorer/projectnodes.h b/src/plugins/projectexplorer/projectnodes.h index c8a32003bb..bb3d6d6727 100644 --- a/src/plugins/projectexplorer/projectnodes.h +++ b/src/plugins/projectexplorer/projectnodes.h @@ -155,6 +155,7 @@ public: void setParentFolderNode(FolderNode *parentFolder); void setListInProject(bool l); + void setIsGenerated(bool g); static FileType fileTypeForMimeType(const Utils::MimeType &mt); static FileType fileTypeForFileName(const Utils::FileName &file); @@ -164,7 +165,6 @@ protected: const QByteArray &id = {}); void setPriority(int priority); - void setIsGenerated(bool g); private: FolderNode *m_parentFolderNode = nullptr; @@ -185,7 +185,7 @@ private: class PROJECTEXPLORER_EXPORT FileNode : public Node { public: - FileNode(const Utils::FileName &filePath, const FileType fileType, bool generated, int line = -1, + FileNode(const Utils::FileName &filePath, const FileType fileType, int line = -1, const QByteArray &id = {}); FileNode *clone() const; diff --git a/src/plugins/pythoneditor/pythoneditorplugin.cpp b/src/plugins/pythoneditor/pythoneditorplugin.cpp index dfd9c6a50e..b937f9c89e 100644 --- a/src/plugins/pythoneditor/pythoneditorplugin.cpp +++ b/src/plugins/pythoneditor/pythoneditorplugin.cpp @@ -471,7 +471,7 @@ class PythonFileNode : public FileNode public: PythonFileNode(const Utils::FileName &filePath, const QString &nodeDisplayName, FileType fileType = FileType::Source) - : FileNode(filePath, fileType, false) + : FileNode(filePath, fileType) , m_displayName(nodeDisplayName) {} diff --git a/src/plugins/qbsprojectmanager/qbsnodes.cpp b/src/plugins/qbsprojectmanager/qbsnodes.cpp index 50b3957eca..6b4738720e 100644 --- a/src/plugins/qbsprojectmanager/qbsnodes.cpp +++ b/src/plugins/qbsprojectmanager/qbsnodes.cpp @@ -236,10 +236,9 @@ static bool supportsNodeAction(ProjectAction action, const Node *node) QbsFileNode::QbsFileNode(const Utils::FileName &filePath, const ProjectExplorer::FileType fileType, - bool generated, int line) : - ProjectExplorer::FileNode(filePath, fileType, generated, line) -{ } + ProjectExplorer::FileNode(filePath, fileType, line, QByteArray{}) +{} QString QbsFileNode::displayName() const { diff --git a/src/plugins/qbsprojectmanager/qbsnodes.h b/src/plugins/qbsprojectmanager/qbsnodes.h index cdf85b39ed..6e7a3acf2b 100644 --- a/src/plugins/qbsprojectmanager/qbsnodes.h +++ b/src/plugins/qbsprojectmanager/qbsnodes.h @@ -42,7 +42,7 @@ class QbsProject; class QbsFileNode : public ProjectExplorer::FileNode { public: - QbsFileNode(const Utils::FileName &filePath, const ProjectExplorer::FileType fileType, bool generated, + QbsFileNode(const Utils::FileName &filePath, const ProjectExplorer::FileType fileType, int line); QString displayName() const override; diff --git a/src/plugins/qbsprojectmanager/qbsnodetreebuilder.cpp b/src/plugins/qbsprojectmanager/qbsnodetreebuilder.cpp index 022d119190..87827f61c9 100644 --- a/src/plugins/qbsprojectmanager/qbsnodetreebuilder.cpp +++ b/src/plugins/qbsprojectmanager/qbsnodetreebuilder.cpp @@ -73,7 +73,8 @@ void setupArtifacts(ProjectExplorer::FolderNode *root, const QList<qbs::Artifact QLatin1String("linkerscript"), QLatin1String("qrc"), QLatin1String("java.java") }; - auto node = std::make_unique<ProjectExplorer::FileNode>(path, type, isGenerated); + auto node = std::make_unique<ProjectExplorer::FileNode>(path, type); + node->setIsGenerated(isGenerated); node->setListInProject(!isGenerated || ad.fileTags().toSet().intersects(sourceTags)); root->addNestedNode(std::move(node)); } @@ -93,7 +94,7 @@ buildGroupNodeTree(const qbs::GroupData &grp, const QString &productPath, bool p result->setDisplayName(grp.name()); result->addNode(std::make_unique<QbsProjectManager::Internal::QbsFileNode>( Utils::FileName::fromString(grp.location().filePath()), - ProjectExplorer::FileType::Project, false, + ProjectExplorer::FileType::Project, grp.location().line())); ::setupArtifacts(result.get(), grp.allSourceArtifacts()); @@ -114,7 +115,7 @@ void setupQbsProductData(QbsProjectManager::Internal::QbsProductNode *node, // Add QbsFileNode: node->addNode(std::make_unique<QbsFileNode>(Utils::FileName::fromString(prd.location().filePath()), - ProjectExplorer::FileType::Project, false, + ProjectExplorer::FileType::Project, prd.location().line())); @@ -150,7 +151,7 @@ void setupProjectNode(QbsProjectManager::Internal::QbsProjectNode *node, const q { using namespace QbsProjectManager::Internal; node->addNode(std::make_unique<QbsFileNode>(Utils::FileName::fromString(prjData.location().filePath()), - ProjectExplorer::FileType::Project, false, + ProjectExplorer::FileType::Project, prjData.location().line())); foreach (const qbs::ProjectData &subData, prjData.subProjects()) { auto subProject = @@ -222,7 +223,7 @@ std::unique_ptr<QbsRootProjectNode> QbsNodeTreeBuilder::buildTree(QbsProject *pr for (const QString &f : files) { const Utils::FileName filePath = Utils::FileName::fromString(f); if (filePath.isChildOf(base)) - buildSystemFiles->addNestedNode(std::make_unique<ProjectExplorer::FileNode>(filePath, ProjectExplorer::FileType::Project, false)); + buildSystemFiles->addNestedNode(std::make_unique<ProjectExplorer::FileNode>(filePath, ProjectExplorer::FileType::Project)); } buildSystemFiles->compress(); root->addNode(std::move(buildSystemFiles)); diff --git a/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp b/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp index 4953a65946..0934d26896 100644 --- a/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp +++ b/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp @@ -137,7 +137,7 @@ static void createTree(const QmakePriFile *pri, QmakePriFileNode *node, const Fi node->setIcon(qmakeStaticData()->projectIcon); // .pro/.pri-file itself: - node->addNode(std::make_unique<FileNode>(pri->filePath(), FileType::Project, false)); + node->addNode(std::make_unique<FileNode>(pri->filePath(), FileType::Project)); // other normal files: const QVector<QmakeStaticData::FileTypeData> &fileTypes = qmakeStaticData()->fileTypeData; @@ -175,7 +175,7 @@ static void createTree(const QmakePriFile *pri, QmakePriFileNode *node, const Fi // qt quick compiler moves qrc files into it:-/ Get better data based on // the filename. type = FileNode::fileTypeForFileName(fn); - vfolder->addNestedNode(std::make_unique<FileNode>(fn, type, false)); + vfolder->addNestedNode(std::make_unique<FileNode>(fn, type)); } for (FolderNode *fn : vfolder->folderNodes()) fn->compress(); diff --git a/src/plugins/qmlprofiler/tests/qmlprofilerdetailsrewriter_test.cpp b/src/plugins/qmlprofiler/tests/qmlprofilerdetailsrewriter_test.cpp index 88965ca4f2..7ba3b02cdb 100644 --- a/src/plugins/qmlprofiler/tests/qmlprofilerdetailsrewriter_test.cpp +++ b/src/plugins/qmlprofiler/tests/qmlprofilerdetailsrewriter_test.cpp @@ -56,13 +56,13 @@ public: ProjectExplorer::Project(QString(), file, {}) { auto fileNode - = std::make_unique<ProjectExplorer::FileNode>(file, ProjectExplorer::FileType::Source, false); + = std::make_unique<ProjectExplorer::FileNode>(file, ProjectExplorer::FileType::Source); auto root = std::make_unique<DummyProjectNode>(file); root->addNode(std::move(fileNode)); fileNode = std::make_unique<ProjectExplorer::FileNode>( Utils::FileName::fromLatin1( ":/qmlprofiler/tests/qmlprofilerdetailsrewriter_test.cpp"), - ProjectExplorer::FileType::Source, false); + ProjectExplorer::FileType::Source); root->addNode(std::move(fileNode)); setRootProjectNode(std::move(root)); setDisplayName(file.toString()); diff --git a/src/plugins/qmlprojectmanager/qmlproject.cpp b/src/plugins/qmlprojectmanager/qmlproject.cpp index 6082a61682..82d5faf653 100644 --- a/src/plugins/qmlprojectmanager/qmlproject.cpp +++ b/src/plugins/qmlprojectmanager/qmlproject.cpp @@ -358,9 +358,9 @@ void QmlProject::generateProjectTree() const Utils::FileName fileName = Utils::FileName::fromString(f); const FileType fileType = (fileName == projectFilePath()) ? FileType::Project : FileNode::fileTypeForFileName(fileName); - newRoot->addNestedNode(std::make_unique<FileNode>(fileName, fileType, false)); + newRoot->addNestedNode(std::make_unique<FileNode>(fileName, fileType)); } - newRoot->addNestedNode(std::make_unique<FileNode>(projectFilePath(), FileType::Project, false)); + newRoot->addNestedNode(std::make_unique<FileNode>(projectFilePath(), FileType::Project)); setRootProjectNode(std::move(newRoot)); refreshTargetDirectory(); diff --git a/src/plugins/resourceeditor/resourcenode.cpp b/src/plugins/resourceeditor/resourcenode.cpp index 5276bb6929..ee2099bbc0 100644 --- a/src/plugins/resourceeditor/resourcenode.cpp +++ b/src/plugins/resourceeditor/resourcenode.cpp @@ -659,7 +659,7 @@ ResourceTopLevelNode *ResourceFolderNode::resourceNode() const } ResourceFileNode::ResourceFileNode(const FileName &filePath, const QString &qrcPath, const QString &displayName) - : FileNode(filePath, FileNode::fileTypeForFileName(filePath), false) + : FileNode(filePath, FileNode::fileTypeForFileName(filePath)) , m_qrcPath(qrcPath) , m_displayName(displayName) { |