diff --git a/src/plugins/texteditor/fontsettingspage.cpp b/src/plugins/texteditor/fontsettingspage.cpp index 93cd8525bb1bd95cea564c548708cfe45a0f8e55..d61e91f74689574b2a5178961a920d3403126510 100644 --- a/src/plugins/texteditor/fontsettingspage.cpp +++ b/src/plugins/texteditor/fontsettingspage.cpp @@ -458,14 +458,17 @@ void FontSettingsPage::apply() const int size = d_ptr->ui.sizeComboBox->currentText().toInt(&ok); if (ok) d_ptr->m_value.setFontSize(size); + saveSettings(); +} - +void FontSettingsPage::saveSettings() +{ if (d_ptr->m_value != d_ptr->m_lastValue) { - d_ptr->m_lastValue = d_ptr->m_value; - if (QSettings *settings = Core::ICore::instance()->settings()) - d_ptr->m_value.toSettings(d_ptr->m_settingsGroup, d_ptr->m_descriptions, settings); + d_ptr->m_lastValue = d_ptr->m_value; + if (QSettings *settings = Core::ICore::instance()->settings()) + d_ptr->m_value.toSettings(d_ptr->m_settingsGroup, d_ptr->m_descriptions, settings); - QTimer::singleShot(0, this, SLOT(delayedChange())); + QTimer::singleShot(0, this, SLOT(delayedChange())); } } diff --git a/src/plugins/texteditor/fontsettingspage.h b/src/plugins/texteditor/fontsettingspage.h index 3d185d0756ab6745555592d46c49ef93db61e442..21fbbb7d2514e8d216e369ba4c169c0c79ac491f 100644 --- a/src/plugins/texteditor/fontsettingspage.h +++ b/src/plugins/texteditor/fontsettingspage.h @@ -96,6 +96,8 @@ public: void apply(); void finish(); + void saveSettings(); + const FontSettings &fontSettings() const; signals: diff --git a/src/plugins/texteditor/texteditorsettings.cpp b/src/plugins/texteditor/texteditorsettings.cpp index d843128a1d6c476e2dd7ad6b8b1bdaeaa12a5cf9..43099ac88be75df9cf42f6d5568dfcf4e0b42d25 100644 --- a/src/plugins/texteditor/texteditorsettings.cpp +++ b/src/plugins/texteditor/texteditorsettings.cpp @@ -175,7 +175,7 @@ void TextEditorSettings::fontSizeRequested(int pointSize) { FontSettings &fs = const_cast<FontSettings&>(m_fontSettingsPage->fontSettings()); fs.setFontSize(pointSize); - emit fontSettingsChanged(m_fontSettingsPage->fontSettings()); + m_fontSettingsPage->saveSettings(); } FontSettings TextEditorSettings::fontSettings() const