ProjectPart: Allow for line/column information in project file

Keep this information separate so that plugins using the information
do not need to start parsing the project file.

Change-Id: Ibecf431de1b12bbe820c6f8f9c986cffeb4972d2
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Tobias Hunger
2017-02-27 14:02:38 +01:00
parent 8187141b4a
commit cee92463f7
8 changed files with 29 additions and 6 deletions

View File

@@ -1777,10 +1777,15 @@ void CppCodeModelInspectorDialog::updateProjectPartData(const ProjectPart::Ptr &
projectName = project->displayName();
projectFilePath = project->projectFilePath().toUserOutput();
}
QString projectFileLocation = QDir::toNativeSeparators(part->projectFile);
if (part->projectFileLine > 0)
projectFileLocation += ":" + QString::number(part->projectFileLine);
if (part->projectFileColumn > 0)
projectFileLocation += ":" + QString::number(part->projectFileColumn);
KeyValueModel::Table table = KeyValueModel::Table()
<< qMakePair(QString::fromLatin1("Project Part Name"), part->displayName)
<< qMakePair(QString::fromLatin1("Project Part File"),
QDir::toNativeSeparators(part->projectFile))
<< qMakePair(QString::fromLatin1("Project Part File"), projectFileLocation)
<< qMakePair(QString::fromLatin1("Project Name"), projectName)
<< qMakePair(QString::fromLatin1("Project File"), projectFilePath)
<< qMakePair(QString::fromLatin1("Selected For Building"),