forked from qt-creator/qt-creator
Utils: Start Environment/EnvironmentChange consolidation
The plan is now to keep 'Environment' as the concept name, but have what is currently 'EnvironmentChange' as implementation, as keeping a full env vs env change(set) distiction gets messy. First step is to cut the direct dependency of EnvironmentChange from a (current) Environment that causes circularity when moving the implementation. Change-Id: Id8b512b311071611b750b27af59549ce7c2ce8e6 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -417,10 +417,10 @@ void EnvironmentChange::addAppendToPath(const FilePaths &values)
|
||||
m_changeItems.append(Item{std::in_place_index_t<AppendToPath>(), value});
|
||||
}
|
||||
|
||||
EnvironmentChange EnvironmentChange::fromFixedEnvironment(const Environment &fixedEnv)
|
||||
EnvironmentChange EnvironmentChange::fromDictionary(const NameValueDictionary &dict)
|
||||
{
|
||||
EnvironmentChange change;
|
||||
change.m_changeItems.append(Item{std::in_place_index_t<SetFixedEnvironment>(), fixedEnv});
|
||||
change.m_changeItems.append(Item{std::in_place_index_t<SetFixedDictionary>(), dict});
|
||||
return change;
|
||||
}
|
||||
|
||||
@@ -431,8 +431,8 @@ void EnvironmentChange::applyToEnvironment(Environment &env) const
|
||||
case SetSystemEnvironment:
|
||||
env = Environment::systemEnvironment();
|
||||
break;
|
||||
case SetFixedEnvironment:
|
||||
env = std::get<SetFixedEnvironment>(item);
|
||||
case SetFixedDictionary:
|
||||
env = Environment(std::get<SetFixedDictionary>(item));
|
||||
break;
|
||||
case SetValue: {
|
||||
const QPair<QString, QString> data = std::get<SetValue>(item);
|
||||
|
||||
Reference in New Issue
Block a user