forked from qt-creator/qt-creator
CMakeSettingsPage: Reload item data on CMake executable path changed
This fixes missing/outdated 'Version' information and maybe useful for more data later. Change-Id: Ibf302a424d8a3c289d37fc0fabc00ab22e4bde97 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -433,6 +433,7 @@ public:
|
||||
|
||||
private:
|
||||
void updateQchFilePath();
|
||||
void reload();
|
||||
|
||||
CMakeToolItemModel *m_model;
|
||||
QLineEdit *m_displayNameLineEdit;
|
||||
@@ -478,8 +479,8 @@ CMakeToolItemConfigWidget::CMakeToolItemConfigWidget(CMakeToolItemModel *model)
|
||||
|
||||
connect(m_binaryChooser, &PathChooser::rawPathChanged, this, [this]() {
|
||||
updateQchFilePath();
|
||||
m_qchFileChooser->setBaseDirectory(m_binaryChooser->filePath().parentDir());
|
||||
store();
|
||||
reload();
|
||||
});
|
||||
connect(m_qchFileChooser, &PathChooser::rawPathChanged, this, &CMakeToolItemConfigWidget::store);
|
||||
connect(m_displayNameLineEdit, &QLineEdit::textChanged, this, &CMakeToolItemConfigWidget::store);
|
||||
@@ -503,6 +504,18 @@ void CMakeToolItemConfigWidget::updateQchFilePath()
|
||||
m_qchFileChooser->setFilePath(CMakeTool::searchQchFile(m_binaryChooser->filePath()));
|
||||
}
|
||||
|
||||
void CMakeToolItemConfigWidget::reload()
|
||||
{
|
||||
if (!m_id.isValid())
|
||||
return;
|
||||
|
||||
const CMakeToolTreeItem *item = m_model->cmakeToolItem(m_id);
|
||||
if (!item)
|
||||
return;
|
||||
|
||||
load(item);
|
||||
}
|
||||
|
||||
void CMakeToolItemConfigWidget::load(const CMakeToolTreeItem *item)
|
||||
{
|
||||
m_loadingItem = true; // avoid intermediate signal handling
|
||||
|
Reference in New Issue
Block a user