McuSupport: Expand path macros when resetting paths

Path macros were expanded when applying new paths in the
McuSupport options widget, but not when pushing the reset button.
This resulted in paths like {Env:PROGRAMFILES}/SEGGER/JLink,
which are displayed as an error in the UI. The reset-button is
now connected via a signal in McuPackage to the options widget,
since the macro expander is not accessible to the package object
directly.

Task-number: QTCREATORBUG-28500
Change-Id: I962c6eb83142be87e02debbf34f0602683fe6966
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Yasser Grimes <yasser.grimes@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Sivert Krøvel
2023-02-09 15:29:57 +01:00
parent 2d53e90a2b
commit 1e1cc8cd44
3 changed files with 11 additions and 3 deletions

View File

@@ -256,9 +256,7 @@ QWidget *McuPackage::widget()
m_fileChooser->setExpectedKind(m_valueType);
m_fileChooser->lineEdit()->setButtonIcon(FancyLineEdit::Right, Icons::RESET.icon());
m_fileChooser->lineEdit()->setButtonVisible(FancyLineEdit::Right, true);
connect(m_fileChooser->lineEdit(), &FancyLineEdit::rightButtonClicked, this, [&] {
m_fileChooser->setFilePath(m_defaultPath);
});
connect(m_fileChooser->lineEdit(), &FancyLineEdit::rightButtonClicked, this, &McuPackage::reset);
auto layout = new QGridLayout(widget);
layout->setContentsMargins(0, 0, 0, 0);