Implement support for project file open after AddFile action

Change-Id: I5f5372498a34760976cea5b7d6f5f49dd04558db
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Pawel Rutka
2018-02-13 20:26:04 +01:00
committed by pawelrutka
parent 5ea157f0b8
commit 4aced20a21
5 changed files with 48 additions and 7 deletions

View File

@@ -104,11 +104,17 @@ bool CMakeListsNode::showInSimpleTree() const
return false;
}
bool CMakeListsNode::supportsAction(ProjectExplorer::ProjectAction action, const ProjectExplorer::Node *node) const
bool CMakeListsNode::supportsAction(ProjectExplorer::ProjectAction action, const ProjectExplorer::Node *) const
{
return action == ProjectExplorer::ProjectAction::AddNewFile;
}
Utils::optional<Utils::FileName> CMakeListsNode::visibleAfterAddFileAction() const
{
Utils::FileName projFile{filePath()};
return projFile.appendPath("CMakeLists.txt");
}
CMakeProjectNode::CMakeProjectNode(const Utils::FileName &directory) :
ProjectExplorer::ProjectNode(directory)
{
@@ -127,7 +133,7 @@ QString CMakeProjectNode::tooltip() const
return QString();
}
bool CMakeProjectNode::addFiles(const QStringList &filePaths, QStringList *notAdded)
bool CMakeProjectNode::addFiles(const QStringList &filePaths, QStringList *)
{
noAutoAdditionNotify(filePaths, this);
return true; // Return always true as autoadd is not supported!
@@ -157,17 +163,23 @@ QString CMakeTargetNode::tooltip() const
}
bool CMakeTargetNode::supportsAction(ProjectExplorer::ProjectAction action,
const ProjectExplorer::Node *node) const
const ProjectExplorer::Node *) const
{
return action == ProjectExplorer::ProjectAction::AddNewFile;
}
bool CMakeTargetNode::addFiles(const QStringList &filePaths, QStringList *notAdded)
bool CMakeTargetNode::addFiles(const QStringList &filePaths, QStringList *)
{
noAutoAdditionNotify(filePaths, this);
return true; // Return always true as autoadd is not supported!
}
Utils::optional<Utils::FileName> CMakeTargetNode::visibleAfterAddFileAction() const
{
Utils::FileName projFile{filePath()};
return projFile.appendPath("CMakeLists.txt");
}
void CMakeTargetNode::setTargetInformation(const QList<Utils::FileName> &artifacts,
const QString &type)
{