forked from qt-creator/qt-creator
CppTools: De-duplicate and rename function in ProjectPart
Change-Id: I675ce4c9059d8ae4046f6a13aa7c04b88141d443 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -63,16 +63,22 @@ ProjectPart::Ptr ProjectPart::copy() const
|
||||
|
||||
QString ProjectPart::id() const
|
||||
{
|
||||
QString projectPartId = QDir::fromNativeSeparators(projectFile);
|
||||
if (projectFileLine > 0)
|
||||
projectPartId += ":" + QString::number(projectFileLine);
|
||||
if (projectFileColumn > 0)
|
||||
projectPartId += ":" + QString::number(projectFileColumn);
|
||||
QString projectPartId = projectFileLocation();
|
||||
if (!displayName.isEmpty())
|
||||
projectPartId.append(QLatin1Char(' ') + displayName);
|
||||
return projectPartId;
|
||||
}
|
||||
|
||||
QString ProjectPart::projectFileLocation() const
|
||||
{
|
||||
QString location = QDir::fromNativeSeparators(projectFile);
|
||||
if (projectFileLine > 0)
|
||||
location += ":" + QString::number(projectFileLine);
|
||||
if (projectFileColumn > 0)
|
||||
location += ":" + QString::number(projectFileColumn);
|
||||
return location;
|
||||
}
|
||||
|
||||
QByteArray ProjectPart::readProjectConfigFile(const Ptr &projectPart)
|
||||
{
|
||||
QByteArray result;
|
||||
|
||||
Reference in New Issue
Block a user