File indexing completed on 2024-06-09 05:31:00

0001 /*
0002     SPDX-FileCopyrightText: 2022 Bharadwaj Raju <bharadwaj.raju777@protonmail.com>
0003 
0004     SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 */
0006 
0007 #include "globalconfig.h"
0008 
0009 GlobalConfig::GlobalConfig(QObject *parent)
0010     : QObject(parent)
0011     , m_configWatcher(KConfigWatcher::create(KSharedConfig::openConfig(QStringLiteral("plasmaparc"))))
0012 {
0013     connect(m_configWatcher.data(), &KConfigWatcher::configChanged, this, &GlobalConfig::configChanged);
0014     configChanged();
0015 }
0016 
0017 GlobalConfig::~GlobalConfig()
0018 {
0019 }
0020 
0021 void GlobalConfig::configChanged()
0022 {
0023     int step = m_configWatcher->config()->group(QStringLiteral("General")).readEntry(QStringLiteral("VolumeStep"), 5);
0024     if (step != m_volumeStep) {
0025         m_volumeStep = step;
0026         Q_EMIT volumeStepChanged();
0027     }
0028 }
0029 
0030 int GlobalConfig::volumeStep()
0031 {
0032     return m_volumeStep;
0033 }