forked from qt-creator/qt-creator
ProjectExplorer: Allow for disabled nodes in the project tree
Change-Id: I82d8284777f5691eb3ba9cf4ef92da05057aac18 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -134,7 +134,10 @@ QString Node::tooltip() const
|
||||
|
||||
bool Node::isEnabled() const
|
||||
{
|
||||
return parentFolderNode()->isEnabled();
|
||||
if (!m_isEnabled)
|
||||
return false;
|
||||
FolderNode *parent = parentFolderNode();
|
||||
return parent ? parent->isEnabled() : true;
|
||||
}
|
||||
|
||||
QList<ProjectAction> Node::supportedActions(Node *node) const
|
||||
@@ -144,6 +147,14 @@ QList<ProjectAction> Node::supportedActions(Node *node) const
|
||||
return list;
|
||||
}
|
||||
|
||||
void Node::setEnabled(bool enabled)
|
||||
{
|
||||
if (m_isEnabled == enabled)
|
||||
return;
|
||||
m_isEnabled = enabled;
|
||||
emitNodeUpdated();
|
||||
}
|
||||
|
||||
void Node::setProjectNode(ProjectNode *project)
|
||||
{
|
||||
m_projectNode = project;
|
||||
|
||||
Reference in New Issue
Block a user