File indexing completed on 2024-12-15 04:59:00

0001 /*
0002     SPDX-FileCopyrightText: 2018 Friedrich W. H. Kossebau <kossebau@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #include "configstorage.h"
0008 
0009 // KF
0010 #include <KSharedConfig>
0011 
0012 ConfigStorage::ConfigStorage(QObject *parent)
0013     : QObject(parent)
0014 {
0015     auto config = KSharedConfig::openConfig(QStringLiteral("plasma_calendar_astronomicalevents"));
0016     m_generalConfigGroup = config->group("General");
0017 
0018     m_lunarPhaseShown = m_generalConfigGroup.readEntry("showLunarPhase", true);
0019     m_seasonShown = m_generalConfigGroup.readEntry("showSeason", true);
0020 }
0021 
0022 void ConfigStorage::save()
0023 {
0024     m_generalConfigGroup.writeEntry("showLunarPhase", m_lunarPhaseShown);
0025     m_generalConfigGroup.writeEntry("showSeason", m_seasonShown);
0026 
0027     m_generalConfigGroup.sync();
0028 }