diff --git a/src/plugins/cmakeprojectmanager/servermodereader.cpp b/src/plugins/cmakeprojectmanager/servermodereader.cpp index 4a9a02d0a6c..323490e54dd 100644 --- a/src/plugins/cmakeprojectmanager/servermodereader.cpp +++ b/src/plugins/cmakeprojectmanager/servermodereader.cpp @@ -269,7 +269,8 @@ static void addCMakeVFolder(FolderNode *base, const Utils::FileName &basePath, i return; FolderNode *folder = base; if (!displayName.isEmpty()) { - auto newFolder = std::make_unique(basePath, priority); + auto newFolder = std::make_unique(basePath); + newFolder->setPriority(priority); newFolder->setDisplayName(displayName); folder = newFolder.get(); base->addNode(std::move(newFolder)); @@ -954,8 +955,8 @@ void ServerModeReader::addHeaderNodes(ProjectNode *root, const QList static QIcon headerNodeIcon = Core::FileIconProvider::directoryIcon(ProjectExplorer::Constants::FILEOVERLAY_H); - auto headerNode - = std::make_unique(root->filePath(), Node::DefaultPriority - 5); + auto headerNode = std::make_unique(root->filePath()); + headerNode->setPriority(Node::DefaultPriority - 5); headerNode->setDisplayName(tr("")); headerNode->setIcon(headerNodeIcon); diff --git a/src/plugins/projectexplorer/projectnodes.cpp b/src/plugins/projectexplorer/projectnodes.cpp index d789f1a502c..1c629da625b 100644 --- a/src/plugins/projectexplorer/projectnodes.cpp +++ b/src/plugins/projectexplorer/projectnodes.cpp @@ -782,11 +782,10 @@ bool FolderNode::showWhenEmpty() const \sa ProjectExplorer::FileNode, ProjectExplorer::ProjectNode */ -VirtualFolderNode::VirtualFolderNode(const Utils::FileName &folderPath, int priority) : +VirtualFolderNode::VirtualFolderNode(const Utils::FileName &folderPath) : FolderNode(folderPath) { setNodeType(NodeType::VirtualFolder); - setPriority(priority); } QString VirtualFolderNode::addFileFilter() const diff --git a/src/plugins/projectexplorer/projectnodes.h b/src/plugins/projectexplorer/projectnodes.h index d1a25134ae2..678852e854b 100644 --- a/src/plugins/projectexplorer/projectnodes.h +++ b/src/plugins/projectexplorer/projectnodes.h @@ -154,6 +154,7 @@ public: void setListInProject(bool l); void setIsGenerated(bool g); + void setPriority(int priority); static FileType fileTypeForMimeType(const Utils::MimeType &mt); static FileType fileTypeForFileName(const Utils::FileName &file); @@ -163,7 +164,6 @@ protected: Node(const Node &other) = delete; void setNodeType(NodeType nodeType); - void setPriority(int priority); void setLine(int line); void setFilePath(const Utils::FileName &filePath); @@ -309,7 +309,7 @@ private: class PROJECTEXPLORER_EXPORT VirtualFolderNode : public FolderNode { public: - explicit VirtualFolderNode(const Utils::FileName &folderPath, int priority); + explicit VirtualFolderNode(const Utils::FileName &folderPath); void setAddFileFilter(const QString &filter) { m_addFileFilter = filter; } QString addFileFilter() const override; diff --git a/src/plugins/qbsprojectmanager/qbsnodetreebuilder.cpp b/src/plugins/qbsprojectmanager/qbsnodetreebuilder.cpp index 50c547ac5f7..e9e2ecd754d 100644 --- a/src/plugins/qbsprojectmanager/qbsnodetreebuilder.cpp +++ b/src/plugins/qbsprojectmanager/qbsnodetreebuilder.cpp @@ -129,9 +129,8 @@ void setupQbsProductData(QbsProjectManager::Internal::QbsProductNode *node, } // Add "Generated Files" Node: - auto genFiles - = std::make_unique(node->filePath(), - ProjectExplorer::Node::DefaultProjectFilePriority - 10); + auto genFiles = std::make_unique(node->filePath()); + genFiles->setPriority(ProjectExplorer::Node::DefaultProjectFilePriority - 10); genFiles->setDisplayName(QCoreApplication::translate("QbsProductNode", "Generated files")); setupArtifacts(genFiles.get(), prd.generatedArtifacts()); node->addNode(std::move(genFiles)); diff --git a/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp b/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp index 0934d268962..696c8465ca8 100644 --- a/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp +++ b/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp @@ -148,7 +148,8 @@ static void createTree(const QmakePriFile *pri, QmakePriFileNode *node, const Fi }); if (!newFilePaths.isEmpty()) { - auto vfolder = std::make_unique(pri->filePath().parentDir(), Node::DefaultVirtualFolderPriority - i); + auto vfolder = std::make_unique(pri->filePath().parentDir()); + vfolder->setPriority(Node::DefaultVirtualFolderPriority - i); vfolder->setIcon(fileTypes.at(i).icon); vfolder->setDisplayName(fileTypes.at(i).typeName); vfolder->setAddFileFilter(fileTypes.at(i).addFileFilter);