ProjectNodes: Use a set of flags for bools in Node

This has the potential to save some space per node.

Change-Id: I2b8b65c13b355e680965bb7307f9e8d8714dae64
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Tobias Hunger
2017-05-03 12:24:53 +02:00
parent 175643fd7e
commit cea68a3fe3
2 changed files with 8 additions and 5 deletions

View File

@@ -209,7 +209,7 @@ QString Node::tooltip() const
bool Node::isEnabled() const
{
if (!m_isEnabled)
if (!m_flags.testFlag(FlagIsEnabled))
return false;
FolderNode *parent = parentFolderNode();
return parent ? parent->isEnabled() : true;
@@ -222,9 +222,7 @@ bool Node::supportsAction(ProjectAction, Node *) const
void Node::setEnabled(bool enabled)
{
if (m_isEnabled == enabled)
return;
m_isEnabled = enabled;
m_flags.setFlag(FlagIsEnabled, enabled);
}
bool Node::sortByPath(const Node *a, const Node *b)