forked from qt-creator/qt-creator
ProjectExplorer: Let users provide project-specific environment
Add a new project panel where users can set environment variables for the current project in all configurations. Fixes: QTCREATORBUG-21862 Change-Id: Id98c7f1cf579927a8004a63172f193f943556f44 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -90,6 +90,8 @@ const char TARGET_KEY_PREFIX[] = "ProjectExplorer.Project.Target.";
|
||||
const char TARGET_COUNT_KEY[] = "ProjectExplorer.Project.TargetCount";
|
||||
const char EDITOR_SETTINGS_KEY[] = "ProjectExplorer.Project.EditorSettings";
|
||||
const char PLUGIN_SETTINGS_KEY[] = "ProjectExplorer.Project.PluginSettings";
|
||||
|
||||
const char PROJECT_ENV_KEY[] = "ProjectExplorer.Project.Environment";
|
||||
} // namespace
|
||||
|
||||
namespace ProjectExplorer {
|
||||
@@ -867,6 +869,17 @@ void Project::setNamedSettings(const QString &name, const QVariant &value)
|
||||
d->m_pluginSettings.insert(name, value);
|
||||
}
|
||||
|
||||
void Project::setAdditionalEnvironment(const Utils::EnvironmentItems &envItems)
|
||||
{
|
||||
setNamedSettings(PROJECT_ENV_KEY, Utils::NameValueItem::toStringList(envItems));
|
||||
emit environmentChanged();
|
||||
}
|
||||
|
||||
Utils::EnvironmentItems Project::additionalEnvironment() const
|
||||
{
|
||||
return Utils::NameValueItem::fromStringList(namedSettings(PROJECT_ENV_KEY).toStringList());
|
||||
}
|
||||
|
||||
bool Project::needsConfiguration() const
|
||||
{
|
||||
return d->m_targets.size() == 0;
|
||||
|
||||
Reference in New Issue
Block a user