forked from qt-creator/qt-creator
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 <tobias.hunger@qt.io>
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user