Commit f7812edf authored by Roberto Raggi's avatar Roberto Raggi

Update the project.

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