Commit fd5e0a14 authored by hjk's avatar hjk

ProjectExplorer: Remove Node::asSessionNode()

The only remaining uses could be removed or replaced by a
check for no parent node.

Change-Id: I13eba8ae418cf3d404bb3df7d389d72091af38d7
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
parent 4f47a8d7
......@@ -173,8 +173,6 @@ Qt::ItemFlags FlatModel::flags(const QModelIndex &index) const
// We control the only view, and that one does the checks
Qt::ItemFlags f = Qt::ItemIsSelectable|Qt::ItemIsEnabled|Qt::ItemIsDragEnabled;
if (Node *node = nodeForIndex(index)) {
if (node->asSessionNode())
return 0; // no flags for session node...
if (!node->asProjectNode()) {
// either folder or file node
if (node->supportedActions(node).contains(Rename))
......
......@@ -119,7 +119,7 @@ FolderNode *Node::parentFolderNode() const
ProjectNode *Node::managingProject()
{
if (asSessionNode())
if (!m_parentFolderNode)
return nullptr;
ProjectNode *pn = parentProjectNode();
return pn ? pn : asProjectNode(); // projects manage themselves...
......
......@@ -142,8 +142,6 @@ public:
virtual const FolderNode *asFolderNode() const { return nullptr; }
virtual ProjectNode *asProjectNode() { return nullptr; }
virtual const ProjectNode *asProjectNode() const { return nullptr; }
virtual SessionNode *asSessionNode() { return nullptr; }
virtual const SessionNode *asSessionNode() const { return nullptr; }
static bool sortByPath(const Node *a, const Node *b);
void setParentFolderNode(FolderNode *parentFolder);
......@@ -316,9 +314,6 @@ private:
bool showInSimpleTree() const final;
void projectDisplayNameChanged(Node *node);
SessionNode *asSessionNode() final { return this; }
const SessionNode *asSessionNode() const final { return this; }
};
} // namespace ProjectExplorer
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment