forked from qt-creator/qt-creator
CodeStyle: Fix save settings without applying
Change-Id: Iebe4c4fb6f3279592e7933981aba69087db558f9 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -253,11 +253,6 @@ void CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged()
|
||||
if (m_blockUpdates)
|
||||
return;
|
||||
|
||||
if (m_preferences) {
|
||||
auto current = qobject_cast<CppCodeStylePreferences *>(m_preferences->currentPreferences());
|
||||
if (current)
|
||||
current->setCodeStyleSettings(cppCodeStyleSettings());
|
||||
}
|
||||
emit codeStyleSettingsChanged(cppCodeStyleSettings());
|
||||
updatePreview();
|
||||
}
|
||||
@@ -267,12 +262,6 @@ void CppCodeStylePreferencesWidget::slotTabSettingsChanged(const TabSettings &se
|
||||
if (m_blockUpdates)
|
||||
return;
|
||||
|
||||
if (m_preferences) {
|
||||
auto current = qobject_cast<CppCodeStylePreferences *>(m_preferences->currentPreferences());
|
||||
if (current)
|
||||
current->setTabSettings(settings);
|
||||
}
|
||||
|
||||
emit tabSettingsChanged(settings);
|
||||
updatePreview();
|
||||
}
|
||||
@@ -355,6 +344,14 @@ void CppCodeStylePreferencesWidget::addTab(CppCodeStyleWidget *page, QString tab
|
||||
|
||||
void CppCodeStylePreferencesWidget::apply()
|
||||
{
|
||||
if (m_preferences) {
|
||||
auto current = qobject_cast<CppCodeStylePreferences *>(m_preferences->currentPreferences());
|
||||
if (current) {
|
||||
current->setTabSettings(tabSettings());
|
||||
current->setCodeStyleSettings(cppCodeStyleSettings());
|
||||
}
|
||||
}
|
||||
|
||||
emit applyEmitted();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user