Perform initialization in initialization list

Fix Minor - Variable is assigned in constructor body. Consider performing
initialization in initialization list. (CWE-398)
This commit is contained in:
Willyanto Willyanto 2022-10-14 17:39:08 +00:00 committed by Nate Graham
parent b5e5debad3
commit 37fc15f3ad
2 changed files with 2 additions and 2 deletions

View file

@ -20,8 +20,8 @@ MobileShellSettings *MobileShellSettings::self()
MobileShellSettings::MobileShellSettings(QObject *parent)
: QObject{parent}
, m_config{KSharedConfig::openConfig(CONFIG_FILE, KConfig::SimpleConfig)}
{
m_config = KSharedConfig::openConfig(CONFIG_FILE, KConfig::SimpleConfig);
m_configWatcher = KConfigWatcher::create(m_config);
connect(m_configWatcher.data(), &KConfigWatcher::configChanged, this, [this](const KConfigGroup &group, const QByteArrayList &names) -> void {

View file

@ -26,8 +26,8 @@
ShellUtil::ShellUtil(QObject *parent)
: QObject{parent}
, m_launchingApp{nullptr}
, m_localeConfig{KSharedConfig::openConfig(QStringLiteral("kdeglobals"), KConfig::SimpleConfig)}
{
m_localeConfig = KSharedConfig::openConfig(QStringLiteral("kdeglobals"), KConfig::SimpleConfig);
m_localeConfigWatcher = KConfigWatcher::create(m_localeConfig);
// watch for changes to locale config, to update 12/24 hour time