diff options
author | hjk <hjk@qt.io> | 2017-03-27 17:51:19 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2017-03-28 07:10:54 +0000 |
commit | 2ee79677505668853f3271cd0a30b1700e34d512 (patch) | |
tree | b67878c52f24adeb4b879c8dd7e28eea9ed2569c /src/plugins/projectexplorer/projectnodes.h | |
parent | 7f5b37ed14d88df59972682eb6f9a7e76712bda2 (diff) |
ProjectExplorer: Fix enabling state of main project nodes
Since the rootProjectNode() containing the parsed files is now nested
under a new project node the main node needs to delegate enable/disable
decisions.
Task-number: QTCREATORBUG-17922
Change-Id: Ie7bb6d6802072a2127b32c0fe51fb25fc1c9c6cc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/projectnodes.h')
-rw-r--r-- | src/plugins/projectexplorer/projectnodes.h | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/src/plugins/projectexplorer/projectnodes.h b/src/plugins/projectexplorer/projectnodes.h index 757529da8b..4ed5b4eb56 100644 --- a/src/plugins/projectexplorer/projectnodes.h +++ b/src/plugins/projectexplorer/projectnodes.h @@ -39,6 +39,8 @@ namespace Utils { class MimeType; } namespace ProjectExplorer { + +class Project; class RunConfiguration; enum class NodeType : quint16 { @@ -92,6 +94,7 @@ enum ProjectAction { class FileNode; class FolderNode; class ProjectNode; +class ContainerNode; // Documentation inside. class PROJECTEXPLORER_EXPORT Node : public QObject @@ -115,8 +118,9 @@ public: FolderNode *parentFolderNode() const; // parent folder or project ProjectNode *managingProject(); // project managing this node. - // result is nullptr if node is the SessionNode - // or node if node is a ProjectNode directly below SessionNode + // result is the container's rootProject node if this is a project container node + // (i.e. possibly null) + // or node if node is a top-level ProjectNode directly below a container // or node->parentProjectNode() for all other cases. const ProjectNode *managingProject() const; // see above. @@ -137,6 +141,8 @@ public: virtual const FolderNode *asFolderNode() const { return nullptr; } virtual ProjectNode *asProjectNode() { return nullptr; } virtual const ProjectNode *asProjectNode() const { return nullptr; } + virtual ContainerNode *asContainerNode() { return nullptr; } + virtual const ContainerNode *asContainerNode() const { return nullptr; } static bool sortByPath(const Node *a, const Node *b); void setParentFolderNode(FolderNode *parentFolder); @@ -297,6 +303,24 @@ protected: explicit ProjectNode(const Utils::FileName &projectFilePath); }; +class PROJECTEXPLORER_EXPORT ContainerNode : public FolderNode +{ +public: + ContainerNode(Project *project); + + QString displayName() const final; + QList<ProjectAction> supportedActions(Node *node) const final; + + ContainerNode *asContainerNode() final { return this; } + const ContainerNode *asContainerNode() const final { return this; } + + ProjectNode *rootProjectNode() const; + +private: + Project *m_project; + QList<Node *> m_nodes; +}; + } // namespace ProjectExplorer Q_DECLARE_METATYPE(ProjectExplorer::Node *) |