Centralize handling of file-kind variables.

Change-Id: I400e28ae7d1d4f0250519dcd3c85746da1ea1e93
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Eike Ziller
2013-03-11 11:05:06 +01:00
parent ec4a101405
commit d3341b996c
6 changed files with 54 additions and 26 deletions

View File

@@ -49,14 +49,12 @@ bool ProjectExpander::resolveProjectMacro(const QString &name, QString *ret)
result = m_projectName;
found = true;
}
} else if (name == QLatin1String(ProjectExplorer::Constants::VAR_CURRENTPROJECT_PATH)) {
} else if (Core::VariableManager::instance()->isFileVariable(
name.toUtf8(), ProjectExplorer::Constants::VAR_CURRENTPROJECT_PREFIX)) {
if (!m_projectFile.filePath().isEmpty()) {
result = m_projectFile.absolutePath();
found = true;
}
} else if (name == QLatin1String(ProjectExplorer::Constants::VAR_CURRENTPROJECT_FILEPATH)) {
if (!m_projectFile.filePath().isEmpty()) {
result = m_projectFile.absoluteFilePath();
result = Core::VariableManager::instance()->fileVariableValue(name.toUtf8(),
ProjectExplorer::Constants::VAR_CURRENTPROJECT_PREFIX,
m_projectFile);
found = true;
}
} else if (m_kit && name == QLatin1String(ProjectExplorer::Constants::VAR_CURRENTKIT_NAME)) {