Skip to content

Commit

Permalink
ProjectNodes: Sprinkle override over the Node classes
Browse files Browse the repository at this point in the history
Change-Id: I87db3a1b212aa0a3f140b8d299679f6c1f691004
Reviewed-by: Eike Ziller <[email protected]>
  • Loading branch information
hunger committed Oct 30, 2015
1 parent 66982fc commit e60f62c
Show file tree
Hide file tree
Showing 9 changed files with 82 additions and 84 deletions.
4 changes: 2 additions & 2 deletions src/plugins/autotoolsprojectmanager/autotoolsprojectnode.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ class AutotoolsProjectNode : public ProjectExplorer::ProjectNode
public:
AutotoolsProjectNode(AutotoolsProject *project, Core::IDocument *projectFile);

bool showInSimpleTree() const;
QList<ProjectExplorer::ProjectAction> supportedActions(Node *node) const;
bool showInSimpleTree() const override;
QList<ProjectExplorer::ProjectAction> supportedActions(Node *node) const override;

private:
AutotoolsProject *m_project;
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/cmakeprojectmanager/cmakeprojectnodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class CMakeProjectNode : public ProjectExplorer::ProjectNode
friend class CMakeProject;
public:
CMakeProjectNode(const Utils::FileName &fileName);
virtual bool showInSimpleTree() const;
virtual QList<ProjectExplorer::ProjectAction> supportedActions(Node *node) const;
bool showInSimpleTree() const override;
QList<ProjectExplorer::ProjectAction> supportedActions(Node *node) const override;
};

} // namespace Internal
Expand Down
10 changes: 5 additions & 5 deletions src/plugins/genericprojectmanager/genericprojectnodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ class GenericProjectNode : public ProjectExplorer::ProjectNode
Core::IDocument *projectFile() const;
QString projectFilePath() const;

bool showInSimpleTree() const;
bool showInSimpleTree() const override;

QList<ProjectExplorer::ProjectAction> supportedActions(Node *node) const;
QList<ProjectExplorer::ProjectAction> 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<QString> oldFileList = QSet<QString>());

Expand Down
20 changes: 10 additions & 10 deletions src/plugins/projectexplorer/projectnodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<FileNode*> fileNodes() const;
Expand Down Expand Up @@ -213,7 +213,7 @@ class PROJECTEXPLORER_EXPORT FolderNode : public Node
void addFolderNodes(const QList<FolderNode*> &subFolders);
void removeFolderNodes(const QList<FolderNode*> &subFolders);

FolderNode *asFolderNode();
FolderNode *asFolderNode() override;

protected:
QList<FolderNode*> m_subFolderNodes;
Expand All @@ -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:
Expand Down Expand Up @@ -291,18 +291,18 @@ class PROJECTEXPLORER_EXPORT SessionNode : public FolderNode
public:
SessionNode();

QList<ProjectAction> supportedActions(Node *node) const;
QList<ProjectAction> supportedActions(Node *node) const override;

QList<ProjectNode*> 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<ProjectNode*> &projectNodes);
void removeProjectNodes(const QList<ProjectNode*> &projectNodes);
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/pythoneditor/pythoneditorplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
40 changes: 20 additions & 20 deletions src/plugins/qbsprojectmanager/qbsnodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -64,7 +64,7 @@ class QbsFolderNode : public ProjectExplorer::FolderNode
const QString &displayName);

private:
QList<ProjectExplorer::ProjectAction> supportedActions(ProjectExplorer::Node *node) const;
QList<ProjectExplorer::ProjectAction> supportedActions(ProjectExplorer::Node *node) const override;
};

// ---------------------------------------------------------------------------
Expand All @@ -78,9 +78,9 @@ class QbsBaseProjectNode : public ProjectExplorer::ProjectNode
public:
explicit QbsBaseProjectNode(const Utils::FileName &path);

bool showInSimpleTree() const;
bool showInSimpleTree() const override;

QList<ProjectExplorer::ProjectAction> supportedActions(Node *node) const;
QList<ProjectExplorer::ProjectAction> supportedActions(Node *node) const override;
private:
friend class QbsGroupNode;
};
Expand All @@ -94,11 +94,11 @@ class QbsGroupNode : public QbsBaseProjectNode
public:
QbsGroupNode(const qbs::GroupData &grp, const QString &productPath);

bool isEnabled() const;
QList<ProjectExplorer::ProjectAction> 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<ProjectExplorer::ProjectAction> 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);

Expand Down Expand Up @@ -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<ProjectExplorer::ProjectAction> 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<ProjectExplorer::ProjectAction> 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<ProjectExplorer::RunConfiguration *> runConfigurations() const;
QList<ProjectExplorer::RunConfiguration *> runConfigurations() const override;

private:
QbsGroupNode *findGroupNode(const QString &name);
Expand All @@ -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);
Expand All @@ -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;
};

Expand Down
44 changes: 21 additions & 23 deletions src/plugins/qmakeprojectmanager/qmakenodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,36 +138,36 @@ 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<ProjectExplorer::ProjectAction> supportedActions(Node *node) const;
// ProjectNode interface
QList<ProjectExplorer::ProjectAction> 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(),
int flags = QmakeProjectManager::Internal::ProWriter::ReplaceValues);

bool folderChanged(const QString &changedFolder, const QSet<Utils::FileName> &newFiles);

bool deploysFolder(const QString &folder) const;
QList<ProjectExplorer::RunConfiguration *> runConfigurations() const;
bool deploysFolder(const QString &folder) const override;
QList<ProjectExplorer::RunConfiguration *> runConfigurations() const override;

QmakeProFileNode *proFileNode() const;
QList<QmakePriFileNode*> subProjectNodesExact() const;
Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -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;

Expand Down
12 changes: 6 additions & 6 deletions src/plugins/qmlprojectmanager/qmlprojectnodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<ProjectExplorer::ProjectAction> supportedActions(Node *node) const;
virtual QList<ProjectExplorer::ProjectAction> 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();

Expand Down
30 changes: 15 additions & 15 deletions src/plugins/resourceeditor/resourcenode.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<ProjectExplorer::ProjectAction> supportedActions(Node *node) const;
bool addFiles(const QStringList &filePaths, QStringList *notAdded);
bool removeFiles(const QStringList &filePaths, QStringList *notRemoved);
QList<ProjectExplorer::ProjectAction> 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:
Expand All @@ -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<ProjectExplorer::ProjectAction> supportedActions(Node *node) const;
QList<ProjectExplorer::ProjectAction> 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;
Expand All @@ -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<ProjectExplorer::ProjectAction> supportedActions(Node *node) const;
QList<ProjectExplorer::ProjectAction> supportedActions(Node *node) const override;

private:
QString m_displayName;
Expand Down

0 comments on commit e60f62c

Please sign in to comment.