Commit 99aa8007 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by hjk

Remove NULL tests for Core::ICore::settings()

It cannot really be NULL

Change-Id: I7231e00754464347dc5750249f751cda7f831930
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 7ba9c60f
......@@ -47,8 +47,7 @@ CompletionSettingsPage::CompletionSettingsPage(QObject *parent)
: TextEditor::TextEditorOptionsPage(parent)
, m_page(0)
{
if (QSettings *s = Core::ICore::settings())
m_commentsSettings.fromSettings(QLatin1String(CPPTOOLS_SETTINGSGROUP), s);
m_commentsSettings.fromSettings(QLatin1String(CPPTOOLS_SETTINGSGROUP), Core::ICore::settings());
setId(QLatin1String("P.Completion"));
setDisplayName(tr("Completion"));
......@@ -142,8 +141,7 @@ void CompletionSettingsPage::apply()
m_commentsSettings.m_enableDoxygen = m_page->enableDoxygenCheckBox->isChecked();
m_commentsSettings.m_generateBrief = m_page->generateBriefCheckBox->isChecked();
m_commentsSettings.m_leadingAsterisks = m_page->leadingAsterisksCheckBox->isChecked();
if (QSettings *s = Core::ICore::settings())
m_commentsSettings.toSettings(QLatin1String(CPPTOOLS_SETTINGSGROUP), s);
m_commentsSettings.toSettings(QLatin1String(CPPTOOLS_SETTINGSGROUP), Core::ICore::settings());
emit commentsSettingsChanged(m_commentsSettings);
}
......
......@@ -171,55 +171,54 @@ CppToolsSettings::CppToolsSettings(QObject *parent)
pool->loadCustomCodeStyles();
// load global settings (after built-in settings are added to the pool)
if (QSettings *s = Core::ICore::settings()) {
d->m_globalCodeStyle->fromSettings(CppTools::Constants::CPP_SETTINGS_ID, s);
// legacy handling start (Qt Creator Version < 2.4)
const bool legacyTransformed =
s->value(QLatin1String("CppCodeStyleSettings/LegacyTransformed"), false).toBool();
if (!legacyTransformed) {
// creator 2.4 didn't mark yet the transformation (first run of creator 2.4)
// we need to transform the settings only if at least one from
// below settings was already written - otherwise we use
// defaults like it would be the first run of creator 2.4 without stored settings
const QStringList groups = s->childGroups();
const bool needTransform = groups.contains(QLatin1String("textTabPreferences")) ||
groups.contains(QLatin1String("CppTabPreferences")) ||
groups.contains(QLatin1String("CppCodeStyleSettings"));
if (needTransform) {
CppCodeStyleSettings legacyCodeStyleSettings;
if (groups.contains(QLatin1String("CppCodeStyleSettings"))) {
Utils::fromSettings(QLatin1String("CppCodeStyleSettings"),
QString(), s, &legacyCodeStyleSettings);
}
const QString currentFallback = s->value(QLatin1String("CppTabPreferences/CurrentFallback")).toString();
TabSettings legacyTabSettings;
if (currentFallback == QLatin1String("CppGlobal")) {
// no delegate, global overwritten
Utils::fromSettings(QLatin1String("CppTabPreferences"),
QString(), s, &legacyTabSettings);
} else {
// delegating to global
legacyTabSettings = textEditorSettings->codeStyle()->currentTabSettings();
}
// create custom code style out of old settings
QVariant v;
v.setValue(legacyCodeStyleSettings);
TextEditor::ICodeStylePreferences *oldCreator = pool->createCodeStyle(
QLatin1String("legacy"), legacyTabSettings,
v, tr("Old Creator"));
// change the current delegate and save
d->m_globalCodeStyle->setCurrentDelegate(oldCreator);
d->m_globalCodeStyle->toSettings(CppTools::Constants::CPP_SETTINGS_ID, s);
QSettings *s = Core::ICore::settings();
d->m_globalCodeStyle->fromSettings(CppTools::Constants::CPP_SETTINGS_ID, Core::ICore::settings());
// legacy handling start (Qt Creator Version < 2.4)
const bool legacyTransformed =
s->value(QLatin1String("CppCodeStyleSettings/LegacyTransformed"), false).toBool();
if (!legacyTransformed) {
// creator 2.4 didn't mark yet the transformation (first run of creator 2.4)
// we need to transform the settings only if at least one from
// below settings was already written - otherwise we use
// defaults like it would be the first run of creator 2.4 without stored settings
const QStringList groups = s->childGroups();
const bool needTransform = groups.contains(QLatin1String("textTabPreferences")) ||
groups.contains(QLatin1String("CppTabPreferences")) ||
groups.contains(QLatin1String("CppCodeStyleSettings"));
if (needTransform) {
CppCodeStyleSettings legacyCodeStyleSettings;
if (groups.contains(QLatin1String("CppCodeStyleSettings"))) {
Utils::fromSettings(QLatin1String("CppCodeStyleSettings"),
QString(), s, &legacyCodeStyleSettings);
}
// mark old settings as transformed
s->setValue(QLatin1String("CppCodeStyleSettings/LegacyTransformed"), true);
const QString currentFallback = s->value(QLatin1String("CppTabPreferences/CurrentFallback")).toString();
TabSettings legacyTabSettings;
if (currentFallback == QLatin1String("CppGlobal")) {
// no delegate, global overwritten
Utils::fromSettings(QLatin1String("CppTabPreferences"),
QString(), s, &legacyTabSettings);
} else {
// delegating to global
legacyTabSettings = textEditorSettings->codeStyle()->currentTabSettings();
}
// create custom code style out of old settings
QVariant v;
v.setValue(legacyCodeStyleSettings);
TextEditor::ICodeStylePreferences *oldCreator = pool->createCodeStyle(
QLatin1String("legacy"), legacyTabSettings,
v, tr("Old Creator"));
// change the current delegate and save
d->m_globalCodeStyle->setCurrentDelegate(oldCreator);
d->m_globalCodeStyle->toSettings(CppTools::Constants::CPP_SETTINGS_ID, s);
}
// mark old settings as transformed
s->setValue(QLatin1String("CppCodeStyleSettings/LegacyTransformed"), true);
// legacy handling stop
}
......
......@@ -189,11 +189,10 @@ FormEditorW::~FormEditorW()
if (m_context)
Core::ICore::removeContextObject(m_context);
if (m_initStage == FullyInitialized) {
if (QSettings *s = Core::ICore::settings()) {
s->beginGroup(QLatin1String(settingsGroupC));
m_editorWidget->saveSettings(s);
s->endGroup();
}
QSettings *s = Core::ICore::settings();
s->beginGroup(QLatin1String(settingsGroupC));
m_editorWidget->saveSettings(s);
s->endGroup();
m_designMode->unregisterDesignWidget(m_modeWidget);
delete m_modeWidget;
......
......@@ -226,8 +226,7 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
return false;
m_perforcePluginInstance = this;
if (QSettings *settings = Core::ICore::settings())
m_settings.fromSettings(settings);
m_settings.fromSettings(Core::ICore::settings());
addAutoReleasedObject(new SettingsPage);
......
......@@ -887,59 +887,56 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
addAutoReleasedObject(new FolderNavigationWidgetFactory);
addAutoReleasedObject(new DeployConfigurationFactory);
if (QSettings *s = Core::ICore::settings()) {
const QStringList fileNames =
s->value(QLatin1String("ProjectExplorer/RecentProjects/FileNames")).toStringList();
const QStringList displayNames =
s->value(QLatin1String("ProjectExplorer/RecentProjects/DisplayNames")).toStringList();
if (fileNames.size() == displayNames.size()) {
for (int i = 0; i < fileNames.size(); ++i) {
if (QFileInfo(fileNames.at(i)).isFile())
d->m_recentProjects.append(qMakePair(fileNames.at(i), displayNames.at(i)));
}
QSettings *s = Core::ICore::settings();
const QStringList fileNames =
s->value(QLatin1String("ProjectExplorer/RecentProjects/FileNames")).toStringList();
const QStringList displayNames =
s->value(QLatin1String("ProjectExplorer/RecentProjects/DisplayNames")).toStringList();
if (fileNames.size() == displayNames.size()) {
for (int i = 0; i < fileNames.size(); ++i) {
if (QFileInfo(fileNames.at(i)).isFile())
d->m_recentProjects.append(qMakePair(fileNames.at(i), displayNames.at(i)));
}
}
if (QSettings *s = Core::ICore::settings()) {
d->m_projectExplorerSettings.buildBeforeDeploy =
s->value(QLatin1String("ProjectExplorer/Settings/BuildBeforeDeploy"), true).toBool();
d->m_projectExplorerSettings.deployBeforeRun =
s->value(QLatin1String("ProjectExplorer/Settings/DeployBeforeRun"), true).toBool();
d->m_projectExplorerSettings.saveBeforeBuild =
s->value(QLatin1String("ProjectExplorer/Settings/SaveBeforeBuild"), false).toBool();
d->m_projectExplorerSettings.showCompilerOutput =
s->value(QLatin1String("ProjectExplorer/Settings/ShowCompilerOutput"), false).toBool();
d->m_projectExplorerSettings.showRunOutput =
s->value(QLatin1String("ProjectExplorer/Settings/ShowRunOutput"), true).toBool();
d->m_projectExplorerSettings.showDebugOutput =
s->value(QLatin1String("ProjectExplorer/Settings/ShowDebugOutput"), false).toBool();
d->m_projectExplorerSettings.cleanOldAppOutput =
s->value(QLatin1String("ProjectExplorer/Settings/CleanOldAppOutput"), false).toBool();
d->m_projectExplorerSettings.mergeStdErrAndStdOut =
s->value(QLatin1String("ProjectExplorer/Settings/MergeStdErrAndStdOut"), false).toBool();
d->m_projectExplorerSettings.wrapAppOutput =
s->value(QLatin1String("ProjectExplorer/Settings/WrapAppOutput"), true).toBool();
d->m_projectExplorerSettings.buildBeforeDeploy =
s->value(QLatin1String("ProjectExplorer/Settings/BuildBeforeDeploy"), true).toBool();
d->m_projectExplorerSettings.deployBeforeRun =
s->value(QLatin1String("ProjectExplorer/Settings/DeployBeforeRun"), true).toBool();
d->m_projectExplorerSettings.saveBeforeBuild =
s->value(QLatin1String("ProjectExplorer/Settings/SaveBeforeBuild"), false).toBool();
d->m_projectExplorerSettings.showCompilerOutput =
s->value(QLatin1String("ProjectExplorer/Settings/ShowCompilerOutput"), false).toBool();
d->m_projectExplorerSettings.showRunOutput =
s->value(QLatin1String("ProjectExplorer/Settings/ShowRunOutput"), true).toBool();
d->m_projectExplorerSettings.showDebugOutput =
s->value(QLatin1String("ProjectExplorer/Settings/ShowDebugOutput"), false).toBool();
d->m_projectExplorerSettings.cleanOldAppOutput =
s->value(QLatin1String("ProjectExplorer/Settings/CleanOldAppOutput"), false).toBool();
d->m_projectExplorerSettings.mergeStdErrAndStdOut =
s->value(QLatin1String("ProjectExplorer/Settings/MergeStdErrAndStdOut"), false).toBool();
d->m_projectExplorerSettings.wrapAppOutput =
s->value(QLatin1String("ProjectExplorer/Settings/WrapAppOutput"), true).toBool();
#ifdef Q_OS_WIN
QFileInfo jom = QFileInfo(MsvcToolChain::findInstalledJom());
if (!jom.exists())
jom.setFile(Utils::Environment::systemEnvironment().searchInPath(QLatin1String("jom.exe")));
QFileInfo jom = QFileInfo(MsvcToolChain::findInstalledJom());
if (!jom.exists())
jom.setFile(Utils::Environment::systemEnvironment().searchInPath(QLatin1String("jom.exe")));
d->m_projectExplorerSettings.useJom =
s->value(QLatin1String("ProjectExplorer/Settings/UseJom"), jom.exists()).toBool();
d->m_projectExplorerSettings.useJom =
s->value(QLatin1String("ProjectExplorer/Settings/UseJom"), jom.exists()).toBool();
#else
d->m_projectExplorerSettings.useJom = true; // No need to read any settings
d->m_projectExplorerSettings.useJom = true; // No need to read any settings
#endif
d->m_projectExplorerSettings.autorestoreLastSession =
s->value(QLatin1String("ProjectExplorer/Settings/AutoRestoreLastSession"), false).toBool();
d->m_projectExplorerSettings.prompToStopRunControl =
s->value(QLatin1String("ProjectExplorer/Settings/PromptToStopRunControl"), false).toBool();
d->m_projectExplorerSettings.maxAppOutputLines =
s->value(QLatin1String("ProjectExplorer/Settings/MaxAppOutputLines"), 100000).toInt();
d->m_projectExplorerSettings.environmentId =
QUuid(s->value(QLatin1String("ProjectExplorer/Settings/EnvironmentId")).toString());
if (d->m_projectExplorerSettings.environmentId.isNull())
d->m_projectExplorerSettings.environmentId = QUuid::createUuid();
}
d->m_projectExplorerSettings.autorestoreLastSession =
s->value(QLatin1String("ProjectExplorer/Settings/AutoRestoreLastSession"), false).toBool();
d->m_projectExplorerSettings.prompToStopRunControl =
s->value(QLatin1String("ProjectExplorer/Settings/PromptToStopRunControl"), false).toBool();
d->m_projectExplorerSettings.maxAppOutputLines =
s->value(QLatin1String("ProjectExplorer/Settings/MaxAppOutputLines"), 100000).toInt();
d->m_projectExplorerSettings.environmentId =
QUuid(s->value(QLatin1String("ProjectExplorer/Settings/EnvironmentId")).toString());
if (d->m_projectExplorerSettings.environmentId.isNull())
d->m_projectExplorerSettings.environmentId = QUuid::createUuid();
connect(d->m_sessionManagerAction, SIGNAL(triggered()), this, SLOT(showSessionManager()));
connect(d->m_newAction, SIGNAL(triggered()), this, SLOT(newProject()));
......
......@@ -387,8 +387,7 @@ void BauhausPlugin::setSettings(const DesignerSettings &s)
{
if (s != m_settings) {
m_settings = s;
if (QSettings *settings = Core::ICore::settings())
m_settings.toSettings(settings);
m_settings.toSettings(Core::ICore::settings());
}
}
......
......@@ -49,10 +49,8 @@ QuickToolBarSettings::QuickToolBarSettings()
void QuickToolBarSettings::set()
{
if (get() != *this) {
if (QSettings *settings = Core::ICore::settings())
toSettings(settings);
}
if (get() != *this)
toSettings(Core::ICore::settings());
}
void QuickToolBarSettings::fromSettings(QSettings *settings)
......
......@@ -107,47 +107,46 @@ QmlJSToolsSettings::QmlJSToolsSettings(QObject *parent)
pool->loadCustomCodeStyles();
// load global settings (after built-in settings are added to the pool)
if (QSettings *s = Core::ICore::settings()) {
d->m_globalCodeStyle->fromSettings(QmlJSTools::Constants::QML_JS_SETTINGS_ID, s);
// legacy handling start (Qt Creator Version < 2.4)
const bool legacyTransformed =
s->value(QLatin1String("QmlJSTabPreferences/LegacyTransformed"), false).toBool();
if (!legacyTransformed) {
// creator 2.4 didn't mark yet the transformation (first run of creator 2.4)
// we need to transform the settings only if at least one from
// below settings was already written - otherwise we use
// defaults like it would be the first run of creator 2.4 without stored settings
const QStringList groups = s->childGroups();
const bool needTransform = groups.contains(QLatin1String("textTabPreferences")) ||
groups.contains(QLatin1String("QmlJSTabPreferences"));
if (needTransform) {
const QString currentFallback = s->value(QLatin1String("QmlJSTabPreferences/CurrentFallback")).toString();
TabSettings legacyTabSettings;
if (currentFallback == QLatin1String("QmlJSGlobal")) {
// no delegate, global overwritten
Utils::fromSettings(QLatin1String("QmlJSTabPreferences"),
QString(), s, &legacyTabSettings);
} else {
// delegating to global
legacyTabSettings = textEditorSettings->codeStyle()->currentTabSettings();
}
// create custom code style out of old settings
TextEditor::ICodeStylePreferences *oldCreator = pool->createCodeStyle(
QLatin1String("legacy"), legacyTabSettings,
QVariant(), tr("Old Creator"));
// change the current delegate and save
d->m_globalCodeStyle->setCurrentDelegate(oldCreator);
d->m_globalCodeStyle->toSettings(QmlJSTools::Constants::QML_JS_SETTINGS_ID, s);
QSettings *s = Core::ICore::settings();
d->m_globalCodeStyle->fromSettings(QmlJSTools::Constants::QML_JS_SETTINGS_ID, s);
// legacy handling start (Qt Creator Version < 2.4)
const bool legacyTransformed =
s->value(QLatin1String("QmlJSTabPreferences/LegacyTransformed"), false).toBool();
if (!legacyTransformed) {
// creator 2.4 didn't mark yet the transformation (first run of creator 2.4)
// we need to transform the settings only if at least one from
// below settings was already written - otherwise we use
// defaults like it would be the first run of creator 2.4 without stored settings
const QStringList groups = s->childGroups();
const bool needTransform = groups.contains(QLatin1String("textTabPreferences")) ||
groups.contains(QLatin1String("QmlJSTabPreferences"));
if (needTransform) {
const QString currentFallback = s->value(QLatin1String("QmlJSTabPreferences/CurrentFallback")).toString();
TabSettings legacyTabSettings;
if (currentFallback == QLatin1String("QmlJSGlobal")) {
// no delegate, global overwritten
Utils::fromSettings(QLatin1String("QmlJSTabPreferences"),
QString(), s, &legacyTabSettings);
} else {
// delegating to global
legacyTabSettings = textEditorSettings->codeStyle()->currentTabSettings();
}
// mark old settings as transformed
s->setValue(QLatin1String("QmlJSTabPreferences/LegacyTransformed"), true);
// create custom code style out of old settings
TextEditor::ICodeStylePreferences *oldCreator = pool->createCodeStyle(
QLatin1String("legacy"), legacyTabSettings,
QVariant(), tr("Old Creator"));
// change the current delegate and save
d->m_globalCodeStyle->setCurrentDelegate(oldCreator);
d->m_globalCodeStyle->toSettings(QmlJSTools::Constants::QML_JS_SETTINGS_ID, s);
}
// mark old settings as transformed
s->setValue(QLatin1String("QmlJSTabPreferences/LegacyTransformed"), true);
// legacy handling stop
}
......
......@@ -257,8 +257,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e
if (!Core::ICore::mimeDatabase()->addMimeTypes(QLatin1String(":/trolltech.subversion/Subversion.mimetypes.xml"), errorMessage))
return false;
if (QSettings *settings = Core::ICore::settings())
m_settings.fromSettings(settings);
m_settings.fromSettings(Core::ICore::settings());
addAutoReleasedObject(new SettingsPage);
......@@ -1180,8 +1179,7 @@ void SubversionPlugin::setSettings(const SubversionSettings &s)
{
if (s != m_settings) {
m_settings = s;
if (QSettings *settings = Core::ICore::settings())
m_settings.toSettings(settings);
m_settings.toSettings(Core::ICore::settings());
subVersionControl()->emitConfigurationChanged();
}
}
......
......@@ -77,13 +77,12 @@ BehaviorSettingsPage::BehaviorSettingsPagePrivate::BehaviorSettingsPagePrivate
void BehaviorSettingsPage::BehaviorSettingsPagePrivate::init()
{
if (const QSettings *s = Core::ICore::settings()) {
m_codeStyle->fromSettings(m_parameters.settingsPrefix, s);
m_typingSettings.fromSettings(m_parameters.settingsPrefix, s);
m_storageSettings.fromSettings(m_parameters.settingsPrefix, s);
m_behaviorSettings.fromSettings(m_parameters.settingsPrefix, s);
m_extraEncodingSettings.fromSettings(m_parameters.settingsPrefix, s);
}
const QSettings *s = Core::ICore::settings();
m_codeStyle->fromSettings(m_parameters.settingsPrefix, s);
m_typingSettings.fromSettings(m_parameters.settingsPrefix, s);
m_storageSettings.fromSettings(m_parameters.settingsPrefix, s);
m_behaviorSettings.fromSettings(m_parameters.settingsPrefix, s);
m_extraEncodingSettings.fromSettings(m_parameters.settingsPrefix, s);
}
BehaviorSettingsPage::BehaviorSettingsPage(const BehaviorSettingsPageParameters &p,
......
......@@ -53,9 +53,7 @@ DisplaySettingsPage::DisplaySettingsPagePrivate::DisplaySettingsPagePrivate
(const DisplaySettingsPageParameters &p)
: m_parameters(p), m_page(0)
{
if (const QSettings *s = Core::ICore::settings()) {
m_displaySettings.fromSettings(m_parameters.settingsPrefix, s);
}
m_displaySettings.fromSettings(m_parameters.settingsPrefix, Core::ICore::settings());
}
DisplaySettingsPage::DisplaySettingsPage(const DisplaySettingsPageParameters &p,
......@@ -153,8 +151,7 @@ void DisplaySettingsPage::setDisplaySettings(const DisplaySettings &newDisplaySe
{
if (newDisplaySettings != d->m_displaySettings) {
d->m_displaySettings = newDisplaySettings;
if (QSettings *s = Core::ICore::settings())
d->m_displaySettings.toSettings(d->m_parameters.settingsPrefix, s);
d->m_displaySettings.toSettings(d->m_parameters.settingsPrefix, Core::ICore::settings());
emit displaySettingsChanged(newDisplaySettings);
}
......
......@@ -623,8 +623,7 @@ 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::settings())
d_ptr->m_value.toSettings(d_ptr->m_settingsGroup, settings);
d_ptr->m_value.toSettings(d_ptr->m_settingsGroup, Core::ICore::settings());
QTimer::singleShot(0, this, SLOT(delayedChange()));
}
......
......@@ -169,8 +169,7 @@ void HighlighterSettingsPage::settingsFromUI()
m_d->m_settings.setAlertWhenNoDefinition(m_d->m_page->alertWhenNoDefinition->isChecked());
m_d->m_settings.setUseFallbackLocation(m_d->m_page->useFallbackLocation->isChecked());
m_d->m_settings.setIgnoredFilesPatterns(m_d->m_page->ignoreEdit->text());
if (QSettings *s = Core::ICore::settings())
m_d->m_settings.toSettings(m_d->m_settingsPrefix, s);
m_d->m_settings.toSettings(m_d->m_settingsPrefix, Core::ICore::settings());
}
void HighlighterSettingsPage::settingsToUI()
......
......@@ -419,15 +419,13 @@ void SnippetsSettingsPagePrivate::loadSettings()
if (m_ui.groupCombo->count() == 0)
return;
if (QSettings *s = Core::ICore::settings()) {
m_settings.fromSettings(m_settingsPrefix, s);
const QString &lastGroupName = m_settings.lastUsedSnippetGroup();
const int index = m_ui.groupCombo->findText(lastGroupName);
if (index != -1)
m_ui.groupCombo->setCurrentIndex(index);
else
m_ui.groupCombo->setCurrentIndex(0);
}
m_settings.fromSettings(m_settingsPrefix, Core::ICore::settings());
const QString &lastGroupName = m_settings.lastUsedSnippetGroup();
const int index = m_ui.groupCombo->findText(lastGroupName);
if (index != -1)
m_ui.groupCombo->setCurrentIndex(index);
else
m_ui.groupCombo->setCurrentIndex(0);
}
void SnippetsSettingsPagePrivate::writeSettings()
......@@ -435,10 +433,8 @@ void SnippetsSettingsPagePrivate::writeSettings()
if (m_ui.groupCombo->count() == 0)
return;
if (QSettings *s = Core::ICore::settings()) {
m_settings.setLastUsedSnippetGroup(m_ui.groupCombo->currentText());
m_settings.toSettings(m_settingsPrefix, s);
}
m_settings.setLastUsedSnippetGroup(m_ui.groupCombo->currentText());
m_settings.toSettings(m_settingsPrefix, Core::ICore::settings());
}
bool SnippetsSettingsPagePrivate::settingsChanged() const
......
......@@ -229,8 +229,7 @@ TextEditorSettings::TextEditorSettings(QObject *parent)
this, SIGNAL(displaySettingsChanged(TextEditor::DisplaySettings)));
// TODO: Move these settings to TextEditor category
if (QSettings *s = Core::ICore::settings())
m_d->m_completionSettings.fromSettings(QLatin1String("CppTools/"), s);
m_d->m_completionSettings.fromSettings(QLatin1String("CppTools/"), Core::ICore::settings());
}
TextEditorSettings::~TextEditorSettings()
......@@ -336,8 +335,7 @@ void TextEditorSettings::setCompletionSettings(const TextEditor::CompletionSetti
return;
m_d->m_completionSettings = settings;
if (QSettings *s = Core::ICore::settings())
m_d->m_completionSettings.toSettings(QLatin1String("CppTools/"), s);
m_d->m_completionSettings.toSettings(QLatin1String("CppTools/"), Core::ICore::settings());
emit completionSettingsChanged(m_d->m_completionSettings);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment