diff --git a/src/plugins/projectexplorer/projectnodes.cpp b/src/plugins/projectexplorer/projectnodes.cpp index 1c629da625b..86fc719af6e 100644 --- a/src/plugins/projectexplorer/projectnodes.cpp +++ b/src/plugins/projectexplorer/projectnodes.cpp @@ -417,6 +417,14 @@ bool FileNode::supportsAction(ProjectAction action, const Node *node) const return parentFolder && parentFolder->supportsAction(action, node); } +QString FileNode::displayName() const +{ + int l = line(); + if (l < 0) + return Node::displayName(); + return Node::displayName() + ':' + QString::number(l); +} + /*! \class ProjectExplorer::FolderNode diff --git a/src/plugins/projectexplorer/projectnodes.h b/src/plugins/projectexplorer/projectnodes.h index 678852e854b..b34863e455d 100644 --- a/src/plugins/projectexplorer/projectnodes.h +++ b/src/plugins/projectexplorer/projectnodes.h @@ -200,6 +200,7 @@ public: const std::function factory, QFutureInterface> *future = nullptr); bool supportsAction(ProjectAction action, const Node *node) const override; + QString displayName() const override; private: FileType m_fileType; diff --git a/src/plugins/qbsprojectmanager/qbsnodes.cpp b/src/plugins/qbsprojectmanager/qbsnodes.cpp index 91280dac418..1630871aa44 100644 --- a/src/plugins/qbsprojectmanager/qbsnodes.cpp +++ b/src/plugins/qbsprojectmanager/qbsnodes.cpp @@ -242,13 +242,6 @@ QbsFileNode::QbsFileNode(const Utils::FileName &filePath, setLine(line); } -QString QbsFileNode::displayName() const -{ - int l = line(); - if (l < 0) - return ProjectExplorer::FileNode::displayName(); - return ProjectExplorer::FileNode::displayName() + QLatin1Char(':') + QString::number(l); -} // --------------------------------------------------------------------------- // QbsBaseProjectNode: diff --git a/src/plugins/qbsprojectmanager/qbsnodes.h b/src/plugins/qbsprojectmanager/qbsnodes.h index c1296ec5b2d..73a30a4d803 100644 --- a/src/plugins/qbsprojectmanager/qbsnodes.h +++ b/src/plugins/qbsprojectmanager/qbsnodes.h @@ -44,8 +44,6 @@ class QbsFileNode : public ProjectExplorer::FileNode public: QbsFileNode(const Utils::FileName &filePath, const ProjectExplorer::FileType fileType, int line); - - QString displayName() const override; }; // ---------------------------------------------------------------------------