forked from qt-creator/qt-creator
ProjectExplorer: Replace FolderNode ctor display argument
... by use of the setter. Change-Id: Ie6bf15b4dfae4d4e4d98694313b6e7dc9a22c117 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -250,8 +250,9 @@ FolderNode *addChildFolderNode(FolderNode *parent, const QString &childName)
|
|||||||
{
|
{
|
||||||
Utils::FileName parentPath = parent->filePath();
|
Utils::FileName parentPath = parent->filePath();
|
||||||
auto node = std::make_unique<FolderNode>(
|
auto node = std::make_unique<FolderNode>(
|
||||||
parentPath.appendPath(childName), NodeType::Folder, childName);
|
parentPath.appendPath(childName), NodeType::Folder);
|
||||||
FolderNode *childNode = node.get();
|
FolderNode *childNode = node.get();
|
||||||
|
childNode->setDisplayName(childName);
|
||||||
parent->addNode(std::move(node));
|
parent->addNode(std::move(node));
|
||||||
|
|
||||||
return childNode;
|
return childNode;
|
||||||
|
@@ -422,17 +422,14 @@ bool FileNode::supportsAction(ProjectAction action, const Node *node) const
|
|||||||
|
|
||||||
\sa ProjectExplorer::FileNode, ProjectExplorer::ProjectNode
|
\sa ProjectExplorer::FileNode, ProjectExplorer::ProjectNode
|
||||||
*/
|
*/
|
||||||
FolderNode::FolderNode(const Utils::FileName &folderPath, NodeType nodeType,
|
FolderNode::FolderNode(const Utils::FileName &folderPath, NodeType nodeType) :
|
||||||
const QString &displayName) :
|
Node(nodeType)
|
||||||
Node(nodeType),
|
|
||||||
m_displayName(displayName)
|
|
||||||
{
|
{
|
||||||
setFilePath(folderPath);
|
setFilePath(folderPath);
|
||||||
setPriority(DefaultFolderPriority);
|
setPriority(DefaultFolderPriority);
|
||||||
setListInProject(false);
|
setListInProject(false);
|
||||||
setIsGenerated(false);
|
setIsGenerated(false);
|
||||||
if (m_displayName.isEmpty())
|
m_displayName = folderPath.toUserOutput();
|
||||||
m_displayName = folderPath.toUserOutput();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -784,7 +781,7 @@ bool FolderNode::showWhenEmpty() const
|
|||||||
\sa ProjectExplorer::FileNode, ProjectExplorer::ProjectNode
|
\sa ProjectExplorer::FileNode, ProjectExplorer::ProjectNode
|
||||||
*/
|
*/
|
||||||
VirtualFolderNode::VirtualFolderNode(const Utils::FileName &folderPath, int priority) :
|
VirtualFolderNode::VirtualFolderNode(const Utils::FileName &folderPath, int priority) :
|
||||||
FolderNode(folderPath, NodeType::VirtualFolder, QString())
|
FolderNode(folderPath, NodeType::VirtualFolder)
|
||||||
{
|
{
|
||||||
setPriority(priority);
|
setPriority(priority);
|
||||||
}
|
}
|
||||||
@@ -810,10 +807,11 @@ QString VirtualFolderNode::addFileFilter() const
|
|||||||
Creates an uninitialized project node object.
|
Creates an uninitialized project node object.
|
||||||
*/
|
*/
|
||||||
ProjectNode::ProjectNode(const Utils::FileName &projectFilePath) :
|
ProjectNode::ProjectNode(const Utils::FileName &projectFilePath) :
|
||||||
FolderNode(projectFilePath, NodeType::Project, projectFilePath.fileName())
|
FolderNode(projectFilePath, NodeType::Project)
|
||||||
{
|
{
|
||||||
setPriority(DefaultProjectPriority);
|
setPriority(DefaultProjectPriority);
|
||||||
setListInProject(true);
|
setListInProject(true);
|
||||||
|
setDisplayName(projectFilePath.fileName());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ProjectNode::canAddSubProject(const QString &proFilePath) const
|
bool ProjectNode::canAddSubProject(const QString &proFilePath) const
|
||||||
|
@@ -206,8 +206,7 @@ private:
|
|||||||
class PROJECTEXPLORER_EXPORT FolderNode : public Node
|
class PROJECTEXPLORER_EXPORT FolderNode : public Node
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit FolderNode(const Utils::FileName &folderPath, NodeType nodeType = NodeType::Folder,
|
explicit FolderNode(const Utils::FileName &folderPath, NodeType nodeType = NodeType::Folder);
|
||||||
const QString &displayName = QString());
|
|
||||||
|
|
||||||
QString displayName() const override;
|
QString displayName() const override;
|
||||||
QIcon icon() const;
|
QIcon icon() const;
|
||||||
|
@@ -215,8 +215,8 @@ std::unique_ptr<QbsRootProjectNode> QbsNodeTreeBuilder::buildTree(QbsProject *pr
|
|||||||
setupProjectNode(root.get(), project->qbsProjectData(), project->qbsProject());
|
setupProjectNode(root.get(), project->qbsProjectData(), project->qbsProject());
|
||||||
auto buildSystemFiles
|
auto buildSystemFiles
|
||||||
= std::make_unique<ProjectExplorer::FolderNode>(project->projectDirectory(),
|
= std::make_unique<ProjectExplorer::FolderNode>(project->projectDirectory(),
|
||||||
ProjectExplorer::NodeType::Folder,
|
ProjectExplorer::NodeType::Folder);
|
||||||
QCoreApplication::translate("QbsRootProjectNode", "Qbs files"));
|
buildSystemFiles->setDisplayName(QCoreApplication::translate("QbsRootProjectNode", "Qbs files"));
|
||||||
|
|
||||||
Utils::FileName base = project->projectDirectory();
|
Utils::FileName base = project->projectDirectory();
|
||||||
const QStringList &files = unreferencedBuildSystemFiles(project->qbsProject());
|
const QStringList &files = unreferencedBuildSystemFiles(project->qbsProject());
|
||||||
|
Reference in New Issue
Block a user