Commit f7812edf authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Update the project.

parent dd76a16f
...@@ -178,7 +178,12 @@ void GenericProject::parseProject() ...@@ -178,7 +178,12 @@ void GenericProject::parseProject()
_projectIncludePaths.removeDuplicates(); _projectIncludePaths.removeDuplicates();
_generated = convertToAbsoluteFiles(projectInfo.value(QLatin1String("generated")).toStringList()); _generated = convertToAbsoluteFiles(projectInfo.value(QLatin1String("generated")).toStringList());
_defines = projectInfo.value(QLatin1String("defines")).toStringList();
_defines.clear();
QFile configFn(configFileName());
if (configFn.open(QFile::ReadOnly))
_defines = configFn.readAll();
emit fileListChanged(); emit fileListChanged();
} }
...@@ -198,6 +203,8 @@ void GenericProject::refresh() ...@@ -198,6 +203,8 @@ void GenericProject::refresh()
CppTools::CppModelManagerInterface::ProjectInfo pinfo = modelManager->projectInfo(this); CppTools::CppModelManagerInterface::ProjectInfo pinfo = modelManager->projectInfo(this);
pinfo.defines = predefinedMacros; pinfo.defines = predefinedMacros;
pinfo.defines += '\n';
pinfo.defines += _defines;
QStringList allIncludePaths, allFrameworkPaths; QStringList allIncludePaths, allFrameworkPaths;
...@@ -259,12 +266,9 @@ QStringList GenericProject::includePaths() const ...@@ -259,12 +266,9 @@ QStringList GenericProject::includePaths() const
void GenericProject::setIncludePaths(const QStringList &includePaths) void GenericProject::setIncludePaths(const QStringList &includePaths)
{ _includePaths = includePaths; } { _includePaths = includePaths; }
QStringList GenericProject::defines() const QByteArray GenericProject::defines() const
{ return _defines; } { return _defines; }
void GenericProject::setDefines(const QStringList &defines)
{ _defines = defines; }
void GenericProject::setToolChainId(const QString &toolChainId) void GenericProject::setToolChainId(const QString &toolChainId)
{ {
using namespace ProjectExplorer; using namespace ProjectExplorer;
......
...@@ -90,9 +90,7 @@ public: ...@@ -90,9 +90,7 @@ public:
QStringList includePaths() const; QStringList includePaths() const;
void setIncludePaths(const QStringList &includePaths); void setIncludePaths(const QStringList &includePaths);
QStringList defines() const; QByteArray defines() const;
void setDefines(const QStringList &defines);
QStringList allIncludePaths() const; QStringList allIncludePaths() const;
QStringList projectIncludePaths() const; QStringList projectIncludePaths() const;
QStringList files() const; QStringList files() const;
...@@ -124,7 +122,7 @@ private: ...@@ -124,7 +122,7 @@ private:
QStringList _generated; QStringList _generated;
QStringList _includePaths; QStringList _includePaths;
QStringList _projectIncludePaths; QStringList _projectIncludePaths;
QStringList _defines; QByteArray _defines;
GenericProjectNode* _rootNode; GenericProjectNode* _rootNode;
ProjectExplorer::ToolChain *_toolChain; ProjectExplorer::ToolChain *_toolChain;
......
...@@ -79,7 +79,10 @@ void Manager::unregisterProject(GenericProject *project) ...@@ -79,7 +79,10 @@ void Manager::unregisterProject(GenericProject *project)
void Manager::notifyChanged(const QString &fileName) void Manager::notifyChanged(const QString &fileName)
{ {
foreach (GenericProject *project, _projects) { foreach (GenericProject *project, _projects) {
project->refresh(); if (fileName == project->filesFileName() ||
fileName == project->includesFileName() ||
fileName == project->configFileName())
project->refresh();
} }
} }
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