forked from qt-creator/qt-creator
Core: Save less settings
Try to not save settings that weren't changed from their default, and make it possible for defaults to change in the future. Task-number: QTCREATORBUG-24762 Change-Id: If469b72573791bc92ed535edf00271ef09b55386 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -177,11 +177,13 @@ void ThemeChooser::apply()
|
||||
if (index == -1)
|
||||
return;
|
||||
const QString themeId = d->m_themeListModel->themeAt(index).id().toString();
|
||||
QSettings *settings = ICore::settings();
|
||||
QtcSettings *settings = ICore::settings();
|
||||
const QString currentThemeId = ThemeEntry::themeSetting().toString();
|
||||
if (currentThemeId != themeId) {
|
||||
// save filename of selected theme in global config
|
||||
settings->setValue(QLatin1String(Constants::SETTINGS_THEME), themeId);
|
||||
settings->setValueWithDefault(Constants::SETTINGS_THEME,
|
||||
themeId,
|
||||
QString(Constants::DEFAULT_THEME));
|
||||
RestartDialog restartDialog(ICore::dialogParent(),
|
||||
tr("The theme change will take effect after restart."));
|
||||
restartDialog.exec();
|
||||
|
||||
Reference in New Issue
Block a user