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

It cannot really be NULL

Change-Id: I7231e00754464347dc5750249f751cda7f831930
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
Orgad Shaneh
2012-08-09 12:58:51 +03:00
committed by hjk
parent 7ba9c60f55
commit 99aa8007c1
15 changed files with 153 additions and 179 deletions

View File

@@ -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