ProjectExplorer: Reduce qmake specific logic

- add a QString FileNode::buildKey(), returning the build key
  for a build represented by that node, if any.

     * for QmakeProFileNodes the build key is traditionally equal
       to the file name, so use that.

     * for QbsProductNode use the uniqueProductName()

- add a Project::findNodeForBuildKey(QString buildKey) convenience
  function searching a Project(!)Node matching that build key.
  That's the only use case there is right now, and I see no reason
  yet to travers all files (yet).

Change-Id: I388c0e06c03111e12d630899d762448e974a5737
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
hjk
2018-11-28 18:45:18 +01:00
parent a2306bfe78
commit 18669c8215
8 changed files with 29 additions and 4 deletions

View File

@@ -438,6 +438,11 @@ bool QbsProductNode::renameFile(const QString &filePath, const QString &newFileP
return prjNode->project()->renameFileInProduct(filePath, newFilePath, m_qbsProductData, grp);
}
QString QbsProductNode::buildKey() const
{
return QbsProject::uniqueProductName(m_qbsProductData);
}
// --------------------------------------------------------------------
// QbsProjectNode:
// --------------------------------------------------------------------