forked from qt-creator/qt-creator
ProjectNodes: add listInProject() to Node
Add a setter/getter for listInProject to Node and make the project list all nodes with this property set in Project::files. Task-number: QTCREATORBUG-18132 Change-Id: I334e627856d1bc0d033e13c5d629f6657d8d7fee Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -127,6 +127,11 @@ void Node::setPriority(int p)
|
||||
m_priority = p;
|
||||
}
|
||||
|
||||
void Node::setListInProject(bool l)
|
||||
{
|
||||
m_flags.setFlag(FlagListInProject, l);
|
||||
}
|
||||
|
||||
void Node::setIsGenerated(bool g)
|
||||
{
|
||||
m_flags.setFlag(FlagIsGenerated, g);
|
||||
@@ -153,6 +158,14 @@ int Node::priority() const
|
||||
return m_priority;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns \c true if the Node should be listed as part of the projects file list.
|
||||
*/
|
||||
bool Node::listInProject() const
|
||||
{
|
||||
return m_flags.testFlag(FlagListInProject);
|
||||
}
|
||||
|
||||
/*!
|
||||
The project that owns and manages the node. It is the first project in the list
|
||||
of ancestors.
|
||||
@@ -291,6 +304,7 @@ FileNode::FileNode(const Utils::FileName &filePath,
|
||||
bool generated, int line) : Node(NodeType::File, filePath, line),
|
||||
m_fileType(fileType)
|
||||
{
|
||||
setListInProject(true);
|
||||
setIsGenerated(generated);
|
||||
if (fileType == FileType::Project)
|
||||
setPriority(DefaultProjectFilePriority);
|
||||
@@ -303,6 +317,7 @@ FileNode *FileNode::clone() const
|
||||
auto fn = new FileNode(filePath(), fileType(), isGenerated(), line());
|
||||
fn->setEnabled(isEnabled());
|
||||
fn->setPriority(priority());
|
||||
fn->setListInProject(listInProject());
|
||||
return fn;
|
||||
}
|
||||
|
||||
@@ -390,6 +405,7 @@ FolderNode::FolderNode(const Utils::FileName &folderPath, NodeType nodeType, con
|
||||
m_displayName(displayName)
|
||||
{
|
||||
setPriority(DefaultFolderPriority);
|
||||
setListInProject(false);
|
||||
setIsGenerated(false);
|
||||
if (m_displayName.isEmpty())
|
||||
m_displayName = folderPath.toUserOutput();
|
||||
|
||||
Reference in New Issue
Block a user