kwin: remove unused Oxygen::Config methods arguments

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-10-23 06:52:11 +03:00
parent d70570e598
commit e33272eab0
5 changed files with 12 additions and 25 deletions

View file

@ -47,15 +47,15 @@
//_______________________________________________________________________
extern "C"
{
KDE_EXPORT QObject* allocate_config( KConfig* conf, QWidget* parent )
{ return ( new Oxygen::Config( conf, parent ) ); }
KDE_EXPORT QObject* allocate_config( QWidget* parent )
{ return ( new Oxygen::Config( parent ) ); }
}
namespace Oxygen
{
//_______________________________________________________________________
Config::Config( KConfig*, QWidget* parent ):
Config::Config( QWidget* parent ):
QObject( parent )
{

View file

@ -50,7 +50,7 @@ namespace Oxygen {
public:
//! constructor
Config( KConfig* conf, QWidget* parent );
Config( QWidget* parent );
//! destructor
~Config();
@ -65,16 +65,6 @@ namespace Oxygen {
public slots:
//! load configuration
/*! although kconfiggroup argument is not used. It is required by KWin API */
void load( const KConfigGroup& )
{ load(); }
//! save configuration
/*! although kconfiggroup argument is not used. It is required by KWin API */
void save( KConfigGroup& )
{ save(); }
//! load configuration
void load( void );

View file

@ -30,7 +30,6 @@
#include "oxygenexceptionlist.h"
#include <KSharedConfig>
#include <KConfigGroup>
#include <KDebug>
#include <KGlobal>
#include <KWindowInfo>

View file

@ -38,6 +38,7 @@
#include <KConfigGroup>
#include <KVBox>
#include <KLocale>
#include <KDebug>
static QString styleToConfigLib(KConfigGroup &conf)
{
@ -97,13 +98,12 @@ void KWinDecorationModule::load()
if (library.load()) {
void *alloc_ptr = library.resolve("allocate_config");
if (alloc_ptr != nullptr) {
allocatePlugin = (QObject * (*)(KConfigGroup & conf, QWidget * parent))alloc_ptr;
allocatePlugin = (QObject * (*)(QWidget * parent))alloc_ptr;
m_pluginConfigWidget = new KVBox(this);
m_pluginObject = (QObject*)(allocatePlugin(config, m_pluginConfigWidget));
m_pluginObject = (QObject*)(allocatePlugin(m_pluginConfigWidget));
// connect required signals and slots together...
connect(m_pluginObject, SIGNAL(changed()), this, SLOT(slotSelectionChanged()));
connect(this, SIGNAL(pluginSave(KConfigGroup&)), m_pluginObject, SLOT(save(KConfigGroup&)));
}
}
@ -114,9 +114,10 @@ void KWinDecorationModule::load()
void KWinDecorationModule::save()
{
KConfigGroup config(m_kwinConfig, "Style");
emit pluginSave(config);
config.sync();
const bool saved = QMetaObject::invokeMethod(m_pluginObject, "save");
if (!saved) {
kWarning() << "Could not save decoration settings";
}
// We saved, so tell kcmodule that there have been no new user changes made.
emit KCModule::changed(false);

View file

@ -52,16 +52,13 @@ public:
virtual void save();
virtual void defaults();
Q_SIGNALS:
void pluginSave(KConfigGroup &conf);
private slots:
void slotSelectionChanged();
private:
KSharedConfigPtr m_kwinConfig;
QVBoxLayout* m_layout;
QObject* (*allocatePlugin)(KConfigGroup& conf, QWidget* parent);
QObject* (*allocatePlugin)(QWidget* parent);
QObject* m_pluginObject;
QWidget* m_pluginConfigWidget;
};