forked from qt-creator/qt-creator
Settings: Simplify some user code
This is still way too much boiler plate code for the task at hand. Change-Id: Ia03bff3d6947ea6372e3f5d0217c116728742b74 Reviewed-by: Eike Ziller <eike.ziller@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
@@ -590,18 +590,15 @@ void CppCodeStyleSettingsPage::apply()
|
||||
CppCodeStylePreferences *originalCppCodeStylePreferences = CppToolsSettings::instance()->cppCodeStyle();
|
||||
if (originalCppCodeStylePreferences->codeStyleSettings() != m_pageCppCodeStylePreferences->codeStyleSettings()) {
|
||||
originalCppCodeStylePreferences->setCodeStyleSettings(m_pageCppCodeStylePreferences->codeStyleSettings());
|
||||
if (s)
|
||||
originalCppCodeStylePreferences->toSettings(QLatin1String(CppTools::Constants::CPP_SETTINGS_ID), s);
|
||||
originalCppCodeStylePreferences->toSettings(QLatin1String(CppTools::Constants::CPP_SETTINGS_ID), s);
|
||||
}
|
||||
if (originalCppCodeStylePreferences->tabSettings() != m_pageCppCodeStylePreferences->tabSettings()) {
|
||||
originalCppCodeStylePreferences->setTabSettings(m_pageCppCodeStylePreferences->tabSettings());
|
||||
if (s)
|
||||
originalCppCodeStylePreferences->toSettings(QLatin1String(CppTools::Constants::CPP_SETTINGS_ID), s);
|
||||
originalCppCodeStylePreferences->toSettings(QLatin1String(CppTools::Constants::CPP_SETTINGS_ID), s);
|
||||
}
|
||||
if (originalCppCodeStylePreferences->currentDelegate() != m_pageCppCodeStylePreferences->currentDelegate()) {
|
||||
originalCppCodeStylePreferences->setCurrentDelegate(m_pageCppCodeStylePreferences->currentDelegate());
|
||||
if (s)
|
||||
originalCppCodeStylePreferences->toSettings(QLatin1String(CppTools::Constants::CPP_SETTINGS_ID), s);
|
||||
originalCppCodeStylePreferences->toSettings(QLatin1String(CppTools::Constants::CPP_SETTINGS_ID), s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ CppToolsSettings::CppToolsSettings(QObject *parent)
|
||||
|
||||
// load global settings (after built-in settings are added to the pool)
|
||||
QSettings *s = Core::ICore::settings();
|
||||
d->m_globalCodeStyle->fromSettings(QLatin1String(CppTools::Constants::CPP_SETTINGS_ID), Core::ICore::settings());
|
||||
d->m_globalCodeStyle->fromSettings(QLatin1String(CppTools::Constants::CPP_SETTINGS_ID), s);
|
||||
|
||||
// legacy handling start (Qt Creator Version < 2.4)
|
||||
const bool legacyTransformed =
|
||||
|
||||
Reference in New Issue
Block a user