File indexing completed on 2024-05-12 05:28:39

0001 /*
0002  * SPDX-FileCopyrightText: 2014 Hugo Pereira Da Costa <hugo.pereira@free.fr>
0003  *
0004  * SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 #include "breezestyleconfigmodule.h"
0008 
0009 #include <KPluginFactory>
0010 
0011 K_PLUGIN_CLASS_WITH_JSON(Breeze::ConfigurationModule, "breezestyleconfig.json")
0012 
0013 #include "breezestyleconfigmodule.moc"
0014 
0015 namespace Breeze
0016 {
0017 //_______________________________________________________________________
0018 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
0019 ConfigurationModule::ConfigurationModule(QObject *parent, const KPluginMetaData &data)
0020     : KCModule(parent, data)
0021 {
0022     widget()->setLayout(new QVBoxLayout);
0023     widget()->layout()->addWidget(m_config = new StyleConfig(widget()));
0024     connect(m_config, &StyleConfig::changed, this, &KCModule::setNeedsSave);
0025 }
0026 #else
0027 ConfigurationModule::ConfigurationModule(QWidget *parent, const QVariantList &args)
0028     : KCModule(parent, args)
0029 {
0030     setLayout(new QVBoxLayout(this));
0031     layout()->addWidget(m_config = new StyleConfig(this));
0032     connect(m_config, static_cast<void (StyleConfig::*)(bool)>(&StyleConfig::changed), this, static_cast<void (KCModule::*)(bool)>(&KCModule::changed));
0033 }
0034 #endif
0035 
0036 //_______________________________________________________________________
0037 void ConfigurationModule::defaults()
0038 {
0039     m_config->defaults();
0040     KCModule::defaults();
0041 }
0042 
0043 //_______________________________________________________________________
0044 void ConfigurationModule::load()
0045 {
0046     m_config->load();
0047     KCModule::load();
0048 }
0049 
0050 //_______________________________________________________________________
0051 void ConfigurationModule::save()
0052 {
0053     m_config->save();
0054     KCModule::save();
0055 }
0056 
0057 }