aerothemeplasma/kwin/decoration/breeze-v5.93.0/kstyle/config/breezestyleconfigmodule.cpp

58 lines
1.6 KiB
C++
Raw Normal View History

/*
* SPDX-FileCopyrightText: 2014 Hugo Pereira Da Costa <hugo.pereira@free.fr>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "breezestyleconfigmodule.h"
#include <KPluginFactory>
K_PLUGIN_CLASS_WITH_JSON(Breeze::ConfigurationModule, "breezestyleconfig.json")
#include "breezestyleconfigmodule.moc"
namespace Breeze
{
//_______________________________________________________________________
2024-08-09 01:20:25 +00:00
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
ConfigurationModule::ConfigurationModule(QObject *parent, const KPluginMetaData &data)
: KCModule(parent, data)
{
widget()->setLayout(new QVBoxLayout);
widget()->layout()->addWidget(m_config = new StyleConfig(widget()));
connect(m_config, &StyleConfig::changed, this, &KCModule::setNeedsSave);
}
#else
ConfigurationModule::ConfigurationModule(QWidget *parent, const QVariantList &args)
: KCModule(parent, args)
{
setLayout(new QVBoxLayout(this));
layout()->addWidget(m_config = new StyleConfig(this));
connect(m_config, static_cast<void (StyleConfig::*)(bool)>(&StyleConfig::changed), this, static_cast<void (KCModule::*)(bool)>(&KCModule::changed));
}
2024-08-09 01:20:25 +00:00
#endif
//_______________________________________________________________________
void ConfigurationModule::defaults()
{
m_config->defaults();
KCModule::defaults();
}
//_______________________________________________________________________
void ConfigurationModule::load()
{
m_config->load();
KCModule::load();
}
//_______________________________________________________________________
void ConfigurationModule::save()
{
m_config->save();
KCModule::save();
}
}