Commit 90e12652 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Store the toolChain and includePaths in the .user file.

parent 3eafefd2
......@@ -262,13 +262,6 @@ QStringList GenericProject::files(FilesMode fileMode) const
return _rootNode->files();
}
void GenericProject::saveSettingsImpl(ProjectExplorer::PersistentSettingsWriter &writer)
{
qDebug() << Q_FUNC_INFO;
Project::saveSettingsImpl(writer);
}
QStringList GenericProject::targets() const
{
QStringList targets;
......@@ -308,6 +301,26 @@ void GenericProject::restoreSettingsImpl(ProjectExplorer::PersistentSettingsRead
const QFileInfo fileInfo(file()->fileName());
setValue(all, buildDirectory, fileInfo.absolutePath());
}
QString toolChainId = reader.restoreValue(QLatin1String("toolChain")).toString();
if (toolChainId.isEmpty())
toolChainId = QLatin1String("gcc");
toolChainId = toolChainId.toLower(); // ### move
_rootNode->setToolChainId(toolChainId);
const QStringList includePaths = reader.restoreValue(QLatin1String("includePaths")).toStringList();
_rootNode->setIncludePaths(includePaths);
}
void GenericProject::saveSettingsImpl(ProjectExplorer::PersistentSettingsWriter &writer)
{
qDebug() << Q_FUNC_INFO;
Project::saveSettingsImpl(writer);
writer.saveValue("toolChain", _rootNode->toolChainId());
writer.saveValue("includePaths", _rootNode->includePaths());
}
////////////////////////////////////////////////////////////////////////////////////
......
......@@ -74,9 +74,7 @@ void GenericProjectNode::refresh()
_files = convertToAbsoluteFiles(projectPath, projectInfo.value(QLatin1String("files")).toStringList());
_generated = convertToAbsoluteFiles(projectPath, projectInfo.value(QLatin1String("generated")).toStringList());
_includePaths = convertToAbsoluteFiles(projectPath, projectInfo.value(QLatin1String("includes")).toStringList());
_defines = projectInfo.value(QLatin1String("defines")).toStringList();
_toolChainId = projectInfo.value(QLatin1String("toolchain"), QLatin1String("gcc")).toString().toLower();
FileNode *projectFileNode = new FileNode(projectFilePath(), ProjectFileType,
/* generated = */ false);
......@@ -230,12 +228,18 @@ QStringList GenericProjectNode::generated() const
QStringList GenericProjectNode::includePaths() const
{ return _includePaths; }
void GenericProjectNode::setIncludePaths(const QStringList &includePaths)
{ _includePaths = convertToAbsoluteFiles(QDir(path()), includePaths); }
QStringList GenericProjectNode::defines() const
{ return _defines; }
QString GenericProjectNode::toolChainId() const
{ return _toolChainId; }
void GenericProjectNode::setToolChainId(const QString &toolChainId)
{ _toolChainId = toolChainId; }
bool GenericProjectNode::hasTargets() const
{
qDebug() << Q_FUNC_INFO;
......
......@@ -69,11 +69,15 @@ public:
void refresh();
QString toolChainId() const;
void setToolChainId(const QString &toolChainId);
QStringList includePaths() const;
void setIncludePaths(const QStringList &includePaths);
QStringList files() const;
QStringList generated() const;
QStringList includePaths() const;
QStringList defines() const;
QString toolChainId() const;
private:
FolderNode *findOrCreateFolderByName(const QString &filePath);
......
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