Support AddFiles same way as QMake project

Change-Id: Ib1b5e9ba201623b48144766048d3b404ff016131
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Pawel Rutka
2018-02-13 19:23:24 +01:00
committed by pawelrutka
parent b9bdacb27a
commit 5ea157f0b8
2 changed files with 6 additions and 7 deletions

View File

@@ -104,6 +104,11 @@ bool CMakeListsNode::showInSimpleTree() const
return false;
}
bool CMakeListsNode::supportsAction(ProjectExplorer::ProjectAction action, const ProjectExplorer::Node *node) const
{
return action == ProjectExplorer::ProjectAction::AddNewFile;
}
CMakeProjectNode::CMakeProjectNode(const Utils::FileName &directory) :
ProjectExplorer::ProjectNode(directory)
{
@@ -122,12 +127,6 @@ QString CMakeProjectNode::tooltip() const
return QString();
}
bool CMakeProjectNode::supportsAction(ProjectExplorer::ProjectAction action,
const ProjectExplorer::Node *node) const
{
return action == ProjectExplorer::ProjectAction::AddNewFile;
}
bool CMakeProjectNode::addFiles(const QStringList &filePaths, QStringList *notAdded)
{
noAutoAdditionNotify(filePaths, this);

View File

@@ -46,6 +46,7 @@ public:
CMakeListsNode(const Utils::FileName &cmakeListPath);
bool showInSimpleTree() const final;
bool supportsAction(ProjectExplorer::ProjectAction action, const Node *node) const override;
};
class CMakeProjectNode : public ProjectExplorer::ProjectNode
@@ -56,7 +57,6 @@ public:
bool showInSimpleTree() const final;
QString tooltip() const final;
bool supportsAction(ProjectExplorer::ProjectAction action, const Node *node) const override;
bool addFiles(const QStringList &filePaths, QStringList *notAdded) override;
};