From e60f62c131f7596c858553868fb459a931cfde13 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 29 Oct 2015 16:59:27 +0100 Subject: [PATCH] ProjectNodes: Sprinkle override over the Node classes Change-Id: I87db3a1b212aa0a3f140b8d299679f6c1f691004 Reviewed-by: Eike Ziller --- .../autotoolsprojectnode.h | 4 +- .../cmakeprojectmanager/cmakeprojectnodes.h | 4 +- .../genericprojectnodes.h | 10 ++--- src/plugins/projectexplorer/projectnodes.h | 20 ++++----- .../pythoneditor/pythoneditorplugin.cpp | 2 +- src/plugins/qbsprojectmanager/qbsnodes.h | 40 ++++++++--------- src/plugins/qmakeprojectmanager/qmakenodes.h | 44 +++++++++---------- .../qmlprojectmanager/qmlprojectnodes.h | 12 ++--- src/plugins/resourceeditor/resourcenode.h | 30 ++++++------- 9 files changed, 82 insertions(+), 84 deletions(-) diff --git a/src/plugins/autotoolsprojectmanager/autotoolsprojectnode.h b/src/plugins/autotoolsprojectmanager/autotoolsprojectnode.h index 65c001a6124..b801df89016 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsprojectnode.h +++ b/src/plugins/autotoolsprojectmanager/autotoolsprojectnode.h @@ -56,8 +56,8 @@ class AutotoolsProjectNode : public ProjectExplorer::ProjectNode public: AutotoolsProjectNode(AutotoolsProject *project, Core::IDocument *projectFile); - bool showInSimpleTree() const; - QList supportedActions(Node *node) const; + bool showInSimpleTree() const override; + QList supportedActions(Node *node) const override; private: AutotoolsProject *m_project; diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectnodes.h b/src/plugins/cmakeprojectmanager/cmakeprojectnodes.h index ebd92c335a4..7017664d9a8 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectnodes.h +++ b/src/plugins/cmakeprojectmanager/cmakeprojectnodes.h @@ -43,8 +43,8 @@ class CMakeProjectNode : public ProjectExplorer::ProjectNode friend class CMakeProject; public: CMakeProjectNode(const Utils::FileName &fileName); - virtual bool showInSimpleTree() const; - virtual QList supportedActions(Node *node) const; + bool showInSimpleTree() const override; + QList supportedActions(Node *node) const override; }; } // namespace Internal diff --git a/src/plugins/genericprojectmanager/genericprojectnodes.h b/src/plugins/genericprojectmanager/genericprojectnodes.h index 9256c80d49b..b8ebe161fa2 100644 --- a/src/plugins/genericprojectmanager/genericprojectnodes.h +++ b/src/plugins/genericprojectmanager/genericprojectnodes.h @@ -52,13 +52,13 @@ class GenericProjectNode : public ProjectExplorer::ProjectNode Core::IDocument *projectFile() const; QString projectFilePath() const; - bool showInSimpleTree() const; + bool showInSimpleTree() const override; - QList supportedActions(Node *node) const; + QList supportedActions(Node *node) const override; - bool addFiles(const QStringList &filePaths, QStringList *notAdded = 0); - bool removeFiles(const QStringList &filePaths, QStringList *notRemoved = 0); - bool renameFile(const QString &filePath, const QString &newFilePath); + bool addFiles(const QStringList &filePaths, QStringList *notAdded = 0) override; + bool removeFiles(const QStringList &filePaths, QStringList *notRemoved = 0) override; + bool renameFile(const QString &filePath, const QString &newFilePath) override; void refresh(QSet oldFileList = QSet()); diff --git a/src/plugins/projectexplorer/projectnodes.h b/src/plugins/projectexplorer/projectnodes.h index 27a9eabc7e0..6e923f0594e 100644 --- a/src/plugins/projectexplorer/projectnodes.h +++ b/src/plugins/projectexplorer/projectnodes.h @@ -155,7 +155,7 @@ class PROJECTEXPLORER_EXPORT FileNode : public Node FileType fileType() const; bool isGenerated() const; - FileNode *asFileNode(); + FileNode *asFileNode() override; private: // managed by ProjectNode @@ -172,9 +172,9 @@ class PROJECTEXPLORER_EXPORT FolderNode : public Node public: explicit FolderNode(const Utils::FileName &folderPath, NodeType nodeType = FolderNodeType, const QString &displayName = QString()); - virtual ~FolderNode(); + ~FolderNode() override; - QString displayName() const; + QString displayName() const override; QIcon icon() const; QList fileNodes() const; @@ -213,7 +213,7 @@ class PROJECTEXPLORER_EXPORT FolderNode : public Node void addFolderNodes(const QList &subFolders); void removeFolderNodes(const QList &subFolders); - FolderNode *asFolderNode(); + FolderNode *asFolderNode() override; protected: QList m_subFolderNodes; @@ -230,7 +230,7 @@ class PROJECTEXPLORER_EXPORT VirtualFolderNode : public FolderNode { public: explicit VirtualFolderNode(const Utils::FileName &folderPath, int priority); - virtual ~VirtualFolderNode(); + ~VirtualFolderNode() override; int priority() const; private: @@ -291,18 +291,18 @@ class PROJECTEXPLORER_EXPORT SessionNode : public FolderNode public: SessionNode(); - QList supportedActions(Node *node) const; + QList supportedActions(Node *node) const override; QList projectNodes() const; - void accept(NodesVisitor *visitor); + void accept(NodesVisitor *visitor) override; - bool isEnabled() const { return true; } + bool isEnabled() const override { return true; } - bool showInSimpleTree() const; + bool showInSimpleTree() const override; void projectDisplayNameChanged(Node *node); - SessionNode *asSessionNode(); + SessionNode *asSessionNode() override; protected: void addProjectNodes(const QList &projectNodes); void removeProjectNodes(const QList &projectNodes); diff --git a/src/plugins/pythoneditor/pythoneditorplugin.cpp b/src/plugins/pythoneditor/pythoneditorplugin.cpp index b4daa036142..b14f6e2643a 100644 --- a/src/plugins/pythoneditor/pythoneditorplugin.cpp +++ b/src/plugins/pythoneditor/pythoneditorplugin.cpp @@ -778,7 +778,7 @@ class PythonFileNode : public ProjectExplorer::FileNode , m_displayName(nodeDisplayName) {} - QString displayName() const { return m_displayName; } + QString displayName() const override { return m_displayName; } private: QString m_displayName; }; diff --git a/src/plugins/qbsprojectmanager/qbsnodes.h b/src/plugins/qbsprojectmanager/qbsnodes.h index 72196d54add..c368c73d64d 100644 --- a/src/plugins/qbsprojectmanager/qbsnodes.h +++ b/src/plugins/qbsprojectmanager/qbsnodes.h @@ -54,7 +54,7 @@ class QbsFileNode : public ProjectExplorer::FileNode QbsFileNode(const Utils::FileName &filePath, const ProjectExplorer::FileType fileType, bool generated, int line); - QString displayName() const; + QString displayName() const override; }; class QbsFolderNode : public ProjectExplorer::FolderNode @@ -64,7 +64,7 @@ class QbsFolderNode : public ProjectExplorer::FolderNode const QString &displayName); private: - QList supportedActions(ProjectExplorer::Node *node) const; + QList supportedActions(ProjectExplorer::Node *node) const override; }; // --------------------------------------------------------------------------- @@ -78,9 +78,9 @@ class QbsBaseProjectNode : public ProjectExplorer::ProjectNode public: explicit QbsBaseProjectNode(const Utils::FileName &path); - bool showInSimpleTree() const; + bool showInSimpleTree() const override; - QList supportedActions(Node *node) const; + QList supportedActions(Node *node) const override; private: friend class QbsGroupNode; }; @@ -94,11 +94,11 @@ class QbsGroupNode : public QbsBaseProjectNode public: QbsGroupNode(const qbs::GroupData &grp, const QString &productPath); - bool isEnabled() const; - QList supportedActions(Node *node) const; - bool addFiles(const QStringList &filePaths, QStringList *notAdded = 0); - bool removeFiles(const QStringList &filePaths, QStringList *notRemoved = 0); - bool renameFile(const QString &filePath, const QString &newFilePath); + bool isEnabled() const override; + QList supportedActions(Node *node) const override; + bool addFiles(const QStringList &filePaths, QStringList *notAdded = 0) override; + bool removeFiles(const QStringList &filePaths, QStringList *notRemoved = 0) override; + bool renameFile(const QString &filePath, const QString &newFilePath) override; void updateQbsGroupData(const qbs::GroupData &grp, const QString &productPath, bool productWasEnabled, bool productIsEnabled); @@ -130,17 +130,17 @@ class QbsProductNode : public QbsBaseProjectNode public: explicit QbsProductNode(const qbs::Project &project, const qbs::ProductData &prd); - bool isEnabled() const; - bool showInSimpleTree() const; - QList supportedActions(Node *node) const; - bool addFiles(const QStringList &filePaths, QStringList *notAdded = 0); - bool removeFiles(const QStringList &filePaths, QStringList *notRemoved = 0); - bool renameFile(const QString &filePath, const QString &newFilePath); + bool isEnabled() const override; + bool showInSimpleTree() const override; + QList supportedActions(Node *node) const override; + bool addFiles(const QStringList &filePaths, QStringList *notAdded = 0) override; + bool removeFiles(const QStringList &filePaths, QStringList *notRemoved = 0) override; + bool renameFile(const QString &filePath, const QString &newFilePath) override; void setQbsProductData(const qbs::Project &project, const qbs::ProductData prd); const qbs::ProductData qbsProductData() const { return m_qbsProductData; } - QList runConfigurations() const; + QList runConfigurations() const override; private: QbsGroupNode *findGroupNode(const QString &name); @@ -157,13 +157,13 @@ class QbsProjectNode : public QbsBaseProjectNode { public: explicit QbsProjectNode(const Utils::FileName &path); - ~QbsProjectNode(); + ~QbsProjectNode() override; virtual QbsProject *project() const; const qbs::Project qbsProject() const; const qbs::ProjectData qbsProjectData() const { return m_projectData; } - bool showInSimpleTree() const; + bool showInSimpleTree() const override; protected: void update(const qbs::Project &qbsProject, const qbs::ProjectData &prjData); @@ -190,12 +190,12 @@ class QbsRootProjectNode : public QbsProjectNode using QbsProjectNode::update; void update(); - QbsProject *project() const { return m_project; } + QbsProject *project() const override { return m_project; } private: QStringList unreferencedBuildSystemFiles(const qbs::Project &p) const; - QbsProject * const m_project; + QbsProject *const m_project; ProjectExplorer::FolderNode *m_buildSystemFiles; }; diff --git a/src/plugins/qmakeprojectmanager/qmakenodes.h b/src/plugins/qmakeprojectmanager/qmakenodes.h index 2f80f98ab26..e5f3a3eced6 100644 --- a/src/plugins/qmakeprojectmanager/qmakenodes.h +++ b/src/plugins/qmakeprojectmanager/qmakenodes.h @@ -138,27 +138,27 @@ class QMAKEPROJECTMANAGER_EXPORT QmakePriFileNode : public ProjectExplorer::Proj { public: QmakePriFileNode(QmakeProject *project, QmakeProFileNode *qmakeProFileNode, const Utils::FileName &filePath); - ~QmakePriFileNode(); + ~QmakePriFileNode() override; void update(const Internal::PriFileEvalResult &result); -// ProjectNode interface - QList supportedActions(Node *node) const; + // ProjectNode interface + QList supportedActions(Node *node) const override; - bool showInSimpleTree() const { return false; } + bool showInSimpleTree() const override { return false; } - bool canAddSubProject(const QString &proFilePath) const; + bool canAddSubProject(const QString &proFilePath) const override; - bool addSubProjects(const QStringList &proFilePaths); - bool removeSubProjects(const QStringList &proFilePaths); + bool addSubProjects(const QStringList &proFilePaths) override; + bool removeSubProjects(const QStringList &proFilePaths) override; - bool addFiles(const QStringList &filePaths, QStringList *notAdded = 0); - bool removeFiles(const QStringList &filePaths, QStringList *notRemoved = 0); - bool deleteFiles(const QStringList &filePaths); - bool canRenameFile(const QString &filePath, const QString &newFilePath); - bool renameFile(const QString &filePath, const QString &newFilePath); - AddNewInformation addNewInformation(const QStringList &files, Node *context) const; + bool addFiles(const QStringList &filePaths, QStringList *notAdded = 0) override; + bool removeFiles(const QStringList &filePaths, QStringList *notRemoved = 0) override; + bool deleteFiles(const QStringList &filePaths) override; + bool canRenameFile(const QString &filePath, const QString &newFilePath) override; + bool renameFile(const QString &filePath, const QString &newFilePath) override; + AddNewInformation addNewInformation(const QStringList &files, Node *context) const override; bool setProVariable(const QString &var, const QStringList &values, const QString &scope = QString(), @@ -166,8 +166,8 @@ class QMAKEPROJECTMANAGER_EXPORT QmakePriFileNode : public ProjectExplorer::Proj bool folderChanged(const QString &changedFolder, const QSet &newFiles); - bool deploysFolder(const QString &folder) const; - QList runConfigurations() const; + bool deploysFolder(const QString &folder) const override; + QList runConfigurations() const override; QmakeProFileNode *proFileNode() const; QList subProjectNodesExact() const; @@ -265,16 +265,14 @@ class ProVirtualFolderNode : public ProjectExplorer::VirtualFolderNode public: explicit ProVirtualFolderNode(const Utils::FileName &folderPath, int priority, const QString &typeName) : VirtualFolderNode(folderPath, priority), m_typeName(typeName) - { - - } + { } - QString displayName() const + QString displayName() const override { return m_typeName; } - QString tooltip() const + QString tooltip() const override { return QString(); } @@ -328,13 +326,13 @@ class QMAKEPROJECTMANAGER_EXPORT QmakeProFileNode : public QmakePriFileNode { public: QmakeProFileNode(QmakeProject *project, const Utils::FileName &filePath); - ~QmakeProFileNode(); + ~QmakeProFileNode() override; bool isParent(QmakeProFileNode *node); - bool showInSimpleTree() const; + bool showInSimpleTree() const override; - AddNewInformation addNewInformation(const QStringList &files, Node *context) const; + AddNewInformation addNewInformation(const QStringList &files, Node *context) const override; QmakeProjectType projectType() const; diff --git a/src/plugins/qmlprojectmanager/qmlprojectnodes.h b/src/plugins/qmlprojectmanager/qmlprojectnodes.h index 81dc57346c6..7a62d655950 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectnodes.h +++ b/src/plugins/qmlprojectmanager/qmlprojectnodes.h @@ -48,18 +48,18 @@ class QmlProjectNode : public ProjectExplorer::ProjectNode { public: QmlProjectNode(QmlProject *project, Core::IDocument *projectFile); - virtual ~QmlProjectNode(); + ~QmlProjectNode() override; Core::IDocument *projectFile() const; QString projectFilePath() const; - virtual bool showInSimpleTree() const; + virtual bool showInSimpleTree() const override; - virtual QList supportedActions(Node *node) const; + virtual QList supportedActions(Node *node) const override; - virtual bool addFiles(const QStringList &filePaths, QStringList *notAdded = 0); - virtual bool deleteFiles(const QStringList &filePaths); - virtual bool renameFile(const QString &filePath, const QString &newFilePath); + virtual bool addFiles(const QStringList &filePaths, QStringList *notAdded = 0) override; + virtual bool deleteFiles(const QStringList &filePaths) override; + virtual bool renameFile(const QString &filePath, const QString &newFilePath) override; void refresh(); diff --git a/src/plugins/resourceeditor/resourcenode.h b/src/plugins/resourceeditor/resourcenode.h index c900b1cc80c..05666d20a60 100644 --- a/src/plugins/resourceeditor/resourcenode.h +++ b/src/plugins/resourceeditor/resourcenode.h @@ -46,18 +46,18 @@ class RESOURCE_EXPORT ResourceTopLevelNode : public ProjectExplorer::FolderNode { public: ResourceTopLevelNode(const Utils::FileName &filePath, FolderNode *parent); - ~ResourceTopLevelNode(); + ~ResourceTopLevelNode() override; void update(); - QList supportedActions(Node *node) const; - bool addFiles(const QStringList &filePaths, QStringList *notAdded); - bool removeFiles(const QStringList &filePaths, QStringList *notRemoved); + QList supportedActions(Node *node) const override; + bool addFiles(const QStringList &filePaths, QStringList *notAdded) override; + bool removeFiles(const QStringList &filePaths, QStringList *notRemoved) override; bool addPrefix(const QString &prefix, const QString &lang); bool removePrefix(const QString &prefix, const QString &lang); - AddNewInformation addNewInformation(const QStringList &files, Node *context) const; - bool showInSimpleTree() const; + AddNewInformation addNewInformation(const QStringList &files, Node *context) const override; + bool showInSimpleTree() const override; bool removeNonExistingFiles(); private: @@ -70,19 +70,19 @@ class ResourceFolderNode : public ProjectExplorer::FolderNode friend class ResourceEditor::ResourceTopLevelNode; // for updateFiles public: ResourceFolderNode(const QString &prefix, const QString &lang, ResourceTopLevelNode *parent); - ~ResourceFolderNode(); + ~ResourceFolderNode() override; - QList supportedActions(Node *node) const; + QList supportedActions(Node *node) const override; - QString displayName() const; + QString displayName() const override; - bool addFiles(const QStringList &filePaths, QStringList *notAdded); - bool removeFiles(const QStringList &filePaths, QStringList *notRemoved); - bool renameFile(const QString &filePath, const QString &newFilePath); + bool addFiles(const QStringList &filePaths, QStringList *notAdded) override; + bool removeFiles(const QStringList &filePaths, QStringList *notRemoved) override; + bool renameFile(const QString &filePath, const QString &newFilePath) override; bool renamePrefix(const QString &prefix, const QString &lang); - AddNewInformation addNewInformation(const QStringList &files, Node *context) const; + AddNewInformation addNewInformation(const QStringList &files, Node *context) const override; QString prefix() const; QString lang() const; @@ -99,9 +99,9 @@ class ResourceFileNode : public ProjectExplorer::FileNode public: ResourceFileNode(const Utils::FileName &filePath, const QString &qrcPath, ResourceTopLevelNode *topLevel); - QString displayName() const; + QString displayName() const override; QString qrcPath() const; - QList supportedActions(Node *node) const; + QList supportedActions(Node *node) const override; private: QString m_displayName;