Commit e462c962 authored by Daniel Teske's avatar Daniel Teske Committed by Erik Verbruggen

ProjectPart: Add meta information

Add displayname and project file path and a pointer back to the
project.

Change-Id: Ic9a18f52a6291493bd3a95fd3456ed0e1a3c63e3
Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
parent fe62ad28
......@@ -422,6 +422,9 @@ void AutotoolsProject::updateCppCodeModel()
CppTools::CppModelManagerInterface::ProjectInfo pinfo = modelManager->projectInfo(this);
pinfo.clearProjectParts();
CppTools::ProjectPart::Ptr part(new CppTools::ProjectPart);
part->project = this;
part->displayName = displayName();
part->projectFile = projectFilePath();
if (activeTarget()) {
ProjectExplorer::Kit *k = activeTarget()->kit();
......
......@@ -337,6 +337,9 @@ bool CMakeProject::parseCMakeLists()
pinfo.clearProjectParts();
CppTools::ProjectPart::Ptr part(new CppTools::ProjectPart);
part->project = this;
part->displayName = displayName();
part->projectFile = projectFilePath();
part->evaluateToolchain(tc,
cxxflags,
......
......@@ -100,12 +100,14 @@ using namespace ProjectExplorer;
*/
ProjectPart::ProjectPart()
: cVersion(C89)
: project(0)
, cVersion(C89)
, cxxVersion(CXX11)
, cxxExtensions(NoExtensions)
, qtVersion(UnknownQt)
, cWarningFlags(ProjectExplorer::ToolChain::WarningsDefault)
, cxxWarningFlags(ProjectExplorer::ToolChain::WarningsDefault)
{
}
......
......@@ -102,6 +102,9 @@ public:
typedef QSharedPointer<ProjectPart> Ptr;
public:
QString displayName;
QString projectFile;
ProjectExplorer::Project *project;
QList<ProjectFile> files;
QByteArray defines;
QStringList includePaths;
......
......@@ -250,6 +250,9 @@ void GenericProject::refresh(RefreshOptions options)
CppTools::CppModelManagerInterface::ProjectInfo pinfo = modelManager->projectInfo(this);
pinfo.clearProjectParts();
CppTools::ProjectPart::Ptr part(new CppTools::ProjectPart);
part->project = this;
part->displayName = displayName();
part->projectFile = projectFilePath();
Kit *k = activeTarget() ? activeTarget()->kit() : KitManager::defaultKit();
if (ToolChain *tc = ToolChainKitInformation::toolChain(k)) {
......
......@@ -579,6 +579,12 @@ void QbsProject::updateCppCodeModel(const qbs::ProjectData &prj)
QLatin1String(CONFIG_PRECOMPILEDHEADER)).toString();
CppTools::ProjectPart::Ptr part(new CppTools::ProjectPart);
part->project = this;
part->displayName = grp.name();
part->projectFile = QString::fromLatin1("%1:%2:%3")
.arg(grp.location().fileName())
.arg(grp.location().line())
.arg(grp.location().column());
part->evaluateToolchain(ToolChainKitInformation::toolChain(k),
cxxFlags,
cFlags,
......
......@@ -511,6 +511,9 @@ void Qt4Project::updateCppCodeModel()
QStringList allFiles;
foreach (Qt4ProFileNode *pro, proFiles) {
ProjectPart::Ptr part(new ProjectPart);
part->project = this;
part->displayName = pro->displayName();
part->projectFile = pro->path();
if (pro->variableValue(ConfigVar).contains(QLatin1String("qt")))
part->qtVersion = qtVersionForPart;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment