ProjectExplorer: Make "Add New File" work on FolderNodes

The ResoureceNode will be a folder node, this enables that to work for
add new file.

Change-Id: Ifb4827d0900ce550be164c44979c5b72ab947c42
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
Daniel Teske
2014-02-18 16:31:36 +01:00
parent fba7dcdbaa
commit a23b349882
7 changed files with 186 additions and 93 deletions

View File

@@ -180,7 +180,9 @@ bool Node::isEnabled() const
QList<ProjectAction> Node::supportedActions(Node *node) const
{
return parentFolderNode()->supportedActions(node);
QList<ProjectAction> list = parentFolderNode()->supportedActions(node);
list.append(ProjectExplorer::InheritedFromParent);
return list;
}
void Node::setNodeType(NodeType type)
@@ -357,6 +359,12 @@ bool FolderNode::renameFile(const QString &filePath, const QString &newFilePath)
return false;
}
FolderNode::AddNewInformation FolderNode::addNewInformation(const QStringList &files) const
{
Q_UNUSED(files);
return AddNewInformation(QFileInfo(path()).fileName(), 100);
}
/*!
Adds file nodes specified by \a files to the internal list of the folder
and emits the corresponding signals from the projectNode.