QmakeNodes::addNewInformation: Be responsible subfolder nodes

And increase the priority for those too. Fixes the case:

a.pro
 b.pri
   test
 c.pri

Right click on test and add new file. In that case b.pri should be the
node to which the file is added.

Task-number: QTCREATORBUG-12272
Change-Id: I54d144861bc06545db8e71ed33513a0df971dae2
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Daniel Teske
2014-06-02 16:00:07 +02:00
parent ca3e082b35
commit 2ad3147542

View File

@@ -1069,7 +1069,7 @@ bool QmakePriFileNode::renameFile(const QString &filePath, const QString &newFil
ProjectExplorer::FolderNode::AddNewInformation QmakePriFileNode::addNewInformation(const QStringList &files, Node *context) const ProjectExplorer::FolderNode::AddNewInformation QmakePriFileNode::addNewInformation(const QStringList &files, Node *context) const
{ {
Q_UNUSED(files) Q_UNUSED(files)
return ProjectExplorer::FolderNode::AddNewInformation(QFileInfo(path()).fileName(), context == this ? 120 : 90); return ProjectExplorer::FolderNode::AddNewInformation(QFileInfo(path()).fileName(), context->projectNode() == this ? 120 : 90);
} }
bool QmakePriFileNode::priFileWritable(const QString &path) bool QmakePriFileNode::priFileWritable(const QString &path)
@@ -1576,7 +1576,7 @@ bool QmakeProFileNode::showInSimpleTree() const
ProjectExplorer::FolderNode::AddNewInformation QmakeProFileNode::addNewInformation(const QStringList &files, Node *context) const ProjectExplorer::FolderNode::AddNewInformation QmakeProFileNode::addNewInformation(const QStringList &files, Node *context) const
{ {
Q_UNUSED(files) Q_UNUSED(files)
return AddNewInformation(QFileInfo(path()).fileName(), context == this ? 120 : 100); return AddNewInformation(QFileInfo(path()).fileName(), context->projectNode() == this ? 120 : 100);
} }
bool QmakeProFileNode::showInSimpleTree(QmakeProjectType projectType) const bool QmakeProFileNode::showInSimpleTree(QmakeProjectType projectType) const