forked from qt-creator/qt-creator
Utils: Continue Environment/EnvironmentChange consolidation
Make Environment a stack of changes that gets "expanded" to a full environment before things are actively accessed. Later this expansion should be done lazily if possible. Task-number: QTCREATORBUG-28357 Change-Id: If1c7bfdb9f58b81e71c51ed87ee75d6964a47019 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -632,7 +632,7 @@ public:
|
||||
QString m_placeHolderText;
|
||||
QString m_historyCompleterKey;
|
||||
PathChooser::Kind m_expectedKind = PathChooser::File;
|
||||
EnvironmentChange m_environmentChange;
|
||||
Environment m_environment;
|
||||
QPointer<ElidingLabel> m_labelDisplay;
|
||||
QPointer<FancyLineEdit> m_lineEditDisplay;
|
||||
QPointer<PathChooser> m_pathChooserDisplay;
|
||||
@@ -975,16 +975,11 @@ void StringAspect::setExpectedKind(const PathChooser::Kind expectedKind)
|
||||
d->m_pathChooserDisplay->setExpectedKind(expectedKind);
|
||||
}
|
||||
|
||||
void StringAspect::setEnvironmentChange(const EnvironmentChange &change)
|
||||
{
|
||||
d->m_environmentChange = change;
|
||||
if (d->m_pathChooserDisplay)
|
||||
d->m_pathChooserDisplay->setEnvironmentChange(change);
|
||||
}
|
||||
|
||||
void StringAspect::setEnvironment(const Environment &env)
|
||||
{
|
||||
setEnvironmentChange(EnvironmentChange::fromDictionary(env.toDictionary()));
|
||||
d->m_environment = env;
|
||||
if (d->m_pathChooserDisplay)
|
||||
d->m_pathChooserDisplay->setEnvironment(env);
|
||||
}
|
||||
|
||||
void StringAspect::setBaseFileName(const FilePath &baseFileName)
|
||||
@@ -1082,7 +1077,7 @@ void StringAspect::addToLayout(Layouting::LayoutBuilder &builder)
|
||||
d->m_pathChooserDisplay->setHistoryCompleter(d->m_historyCompleterKey);
|
||||
if (d->m_validator)
|
||||
d->m_pathChooserDisplay->setValidationFunction(d->m_validator);
|
||||
d->m_pathChooserDisplay->setEnvironmentChange(d->m_environmentChange);
|
||||
d->m_pathChooserDisplay->setEnvironment(d->m_environment);
|
||||
d->m_pathChooserDisplay->setBaseDirectory(d->m_baseFileName);
|
||||
d->m_pathChooserDisplay->setOpenTerminalHandler(d->m_openTerminal);
|
||||
if (defaultValue() == value())
|
||||
|
||||
Reference in New Issue
Block a user