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

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() ...@@ -422,6 +422,9 @@ void AutotoolsProject::updateCppCodeModel()
CppTools::CppModelManagerInterface::ProjectInfo pinfo = modelManager->projectInfo(this); CppTools::CppModelManagerInterface::ProjectInfo pinfo = modelManager->projectInfo(this);
pinfo.clearProjectParts(); pinfo.clearProjectParts();
CppTools::ProjectPart::Ptr part(new CppTools::ProjectPart); CppTools::ProjectPart::Ptr part(new CppTools::ProjectPart);
part->project = this;
part->displayName = displayName();
part->projectFile = projectFilePath();
if (activeTarget()) { if (activeTarget()) {
ProjectExplorer::Kit *k = activeTarget()->kit(); ProjectExplorer::Kit *k = activeTarget()->kit();
......
...@@ -337,6 +337,9 @@ bool CMakeProject::parseCMakeLists() ...@@ -337,6 +337,9 @@ bool CMakeProject::parseCMakeLists()
pinfo.clearProjectParts(); pinfo.clearProjectParts();
CppTools::ProjectPart::Ptr part(new CppTools::ProjectPart); CppTools::ProjectPart::Ptr part(new CppTools::ProjectPart);
part->project = this;
part->displayName = displayName();
part->projectFile = projectFilePath();
part->evaluateToolchain(tc, part->evaluateToolchain(tc,
cxxflags, cxxflags,
......
...@@ -100,12 +100,14 @@ using namespace ProjectExplorer; ...@@ -100,12 +100,14 @@ using namespace ProjectExplorer;
*/ */
ProjectPart::ProjectPart() ProjectPart::ProjectPart()
: cVersion(C89) : project(0)
, cVersion(C89)
, cxxVersion(CXX11) , cxxVersion(CXX11)
, cxxExtensions(NoExtensions) , cxxExtensions(NoExtensions)
, qtVersion(UnknownQt) , qtVersion(UnknownQt)
, cWarningFlags(ProjectExplorer::ToolChain::WarningsDefault) , cWarningFlags(ProjectExplorer::ToolChain::WarningsDefault)
, cxxWarningFlags(ProjectExplorer::ToolChain::WarningsDefault) , cxxWarningFlags(ProjectExplorer::ToolChain::WarningsDefault)
{ {
} }
......
...@@ -102,6 +102,9 @@ public: ...@@ -102,6 +102,9 @@ public:
typedef QSharedPointer<ProjectPart> Ptr; typedef QSharedPointer<ProjectPart> Ptr;
public: public:
QString displayName;
QString projectFile;
ProjectExplorer::Project *project;
QList<ProjectFile> files; QList<ProjectFile> files;
QByteArray defines; QByteArray defines;
QStringList includePaths; QStringList includePaths;
......
...@@ -250,6 +250,9 @@ void GenericProject::refresh(RefreshOptions options) ...@@ -250,6 +250,9 @@ void GenericProject::refresh(RefreshOptions options)
CppTools::CppModelManagerInterface::ProjectInfo pinfo = modelManager->projectInfo(this); CppTools::CppModelManagerInterface::ProjectInfo pinfo = modelManager->projectInfo(this);
pinfo.clearProjectParts(); pinfo.clearProjectParts();
CppTools::ProjectPart::Ptr part(new CppTools::ProjectPart); CppTools::ProjectPart::Ptr part(new CppTools::ProjectPart);
part->project = this;
part->displayName = displayName();
part->projectFile = projectFilePath();
Kit *k = activeTarget() ? activeTarget()->kit() : KitManager::defaultKit(); Kit *k = activeTarget() ? activeTarget()->kit() : KitManager::defaultKit();
if (ToolChain *tc = ToolChainKitInformation::toolChain(k)) { if (ToolChain *tc = ToolChainKitInformation::toolChain(k)) {
......
...@@ -579,6 +579,12 @@ void QbsProject::updateCppCodeModel(const qbs::ProjectData &prj) ...@@ -579,6 +579,12 @@ void QbsProject::updateCppCodeModel(const qbs::ProjectData &prj)
QLatin1String(CONFIG_PRECOMPILEDHEADER)).toString(); QLatin1String(CONFIG_PRECOMPILEDHEADER)).toString();
CppTools::ProjectPart::Ptr part(new CppTools::ProjectPart); 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), part->evaluateToolchain(ToolChainKitInformation::toolChain(k),
cxxFlags, cxxFlags,
cFlags, cFlags,
......
...@@ -511,6 +511,9 @@ void Qt4Project::updateCppCodeModel() ...@@ -511,6 +511,9 @@ void Qt4Project::updateCppCodeModel()
QStringList allFiles; QStringList allFiles;
foreach (Qt4ProFileNode *pro, proFiles) { foreach (Qt4ProFileNode *pro, proFiles) {
ProjectPart::Ptr part(new ProjectPart); ProjectPart::Ptr part(new ProjectPart);
part->project = this;
part->displayName = pro->displayName();
part->projectFile = pro->path();
if (pro->variableValue(ConfigVar).contains(QLatin1String("qt"))) if (pro->variableValue(ConfigVar).contains(QLatin1String("qt")))
part->qtVersion = qtVersionForPart; 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