forked from qt-creator/qt-creator
ClangFormat: Fix unsaving properties for global settings
- Fixed behavior "Formatting mode" combobox settings isn't saved after pressing "Ok" button when no one project is open. Now it works as expected, settings save after press "Ok" button. - Added additional applying interface for ICodeStylePreferenceFactory which allows pass-through apply call from dialog to the editor. Note: it doesn't work with read-only code style profiles Change-Id: If4f0c85e3105550db4ffd9860e94b678f0d9b386 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -104,7 +104,7 @@ CodeStyleDialog::CodeStyleDialog(ICodeStylePreferencesFactory *factory,
|
||||
m_codeStyle->setValue(codeStyle->value());
|
||||
m_codeStyle->setId(codeStyle->id());
|
||||
m_codeStyle->setDisplayName(m_originalDisplayName);
|
||||
QWidget *editor = factory->createEditor(m_codeStyle, this);
|
||||
TextEditor::CodeStyleEditorWidget *editor = factory->createEditor(m_codeStyle, this);
|
||||
|
||||
m_buttons = new QDialogButtonBox(
|
||||
QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this);
|
||||
@@ -120,6 +120,7 @@ CodeStyleDialog::CodeStyleDialog(ICodeStylePreferencesFactory *factory,
|
||||
|
||||
connect(m_lineEdit, &QLineEdit::textChanged, this, &CodeStyleDialog::slotDisplayNameChanged);
|
||||
connect(m_buttons, &QDialogButtonBox::accepted, this, &QDialog::accept);
|
||||
connect(m_buttons, &QDialogButtonBox::accepted, editor, &TextEditor::CodeStyleEditorWidget::apply);
|
||||
connect(m_buttons, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user