ProjectExplorer::Node::line should be a property not a virtual function

Changing it must emit the same signals as does setting path, since the
sorting might change.

Change-Id: Iaf29c0775387d623d2e611e202b63ab52e812140
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Daniel Teske
2014-02-18 18:06:05 +01:00
parent 23c6a42481
commit d4ad269323
4 changed files with 36 additions and 23 deletions

View File

@@ -222,18 +222,12 @@ public:
QbsFileNode::QbsFileNode(const QString &filePath, const ProjectExplorer::FileType fileType,
bool generated, int line) :
ProjectExplorer::FileNode(filePath, fileType, generated),
m_line(line)
ProjectExplorer::FileNode(filePath, fileType, generated, line)
{ }
void QbsFileNode::setLine(int l)
{
m_line = l;
}
QString QbsFileNode::displayName() const
{
return ProjectExplorer::FileNode::displayName() + QLatin1Char(':') + QString::number(m_line);
return ProjectExplorer::FileNode::displayName() + QLatin1Char(':') + QString::number(line());
}
bool QbsFileNode::update(const qbs::CodeLocation &loc)
@@ -241,8 +235,7 @@ bool QbsFileNode::update(const qbs::CodeLocation &loc)
const QString oldPath = path();
const int oldLine = line();
setPath(loc.fileName());
setLine(loc.line());
setPathAndLine(loc.fileName(), loc.line());
return (line() != oldLine || path() != oldPath);
}