From 1c8fa826edbacb05d19da76dafbc0d27d6178425 Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Fri, 11 May 2007 15:49:22 +0000 Subject: [PATCH] Fix signal/slot (but we don't use argument, perhaps we can cleanup it) svn path=/trunk/KDE/kdebase/workspace/; revision=663562 --- clients/b2/config/config.cpp | 7 ++++--- clients/b2/config/config.h | 4 ++-- clients/default/config/config.cpp | 13 +++++++------ clients/default/config/config.h | 5 +++-- clients/keramik/config/config.cpp | 8 ++++---- clients/keramik/config/config.h | 4 ++-- clients/modernsystem/config/config.cpp | 7 ++++--- clients/modernsystem/config/config.h | 4 ++-- clients/plastik/config/config.cpp | 7 ++++--- clients/plastik/config/config.h | 4 ++-- clients/quartz/config/config.cpp | 7 ++++--- clients/quartz/config/config.h | 4 ++-- kcmkwin/kwindecoration/kwindecoration.cpp | 4 ++-- 13 files changed, 42 insertions(+), 36 deletions(-) diff --git a/clients/b2/config/config.cpp b/clients/b2/config/config.cpp index ef4c310f14..34f94dea3c 100644 --- a/clients/b2/config/config.cpp +++ b/clients/b2/config/config.cpp @@ -71,7 +71,8 @@ B2Config::B2Config( KConfig* conf, QWidget* parent ) "of the menu button. Leave it to none if in doubt.")); // Load configuration options - load(conf); + KConfigGroup cg(b2Config, "General"); + load(cg); // Ensure we track user changes properly connect(cbColorBorder, SIGNAL(clicked()), @@ -100,7 +101,7 @@ void B2Config::slotSelectionChanged() // Loads the configurable options from the kwinrc config file // It is passed the open config from kwindecoration to improve efficiency -void B2Config::load(KConfig * /*conf*/) +void B2Config::load(const KConfigGroup & /*conf*/) { KConfigGroup cg(b2Config, "General"); @@ -145,7 +146,7 @@ static QString opToString(int op) // Saves the configurable options to the kwinrc config file -void B2Config::save(KConfig * /*conf*/) +void B2Config::save(KConfigGroup & /*conf*/) { KConfigGroup cg(b2Config, "General"); cg.writeEntry("UseTitleBarBorderColors", cbColorBorder->isChecked()); diff --git a/clients/b2/config/config.h b/clients/b2/config/config.h index f5253454e8..1748a85b24 100644 --- a/clients/b2/config/config.h +++ b/clients/b2/config/config.h @@ -28,8 +28,8 @@ class B2Config: public QObject void changed(); public slots: - void load( KConfig* conf ); - void save( KConfig* conf ); + void load( const KConfigGroup& conf ); + void save( KConfigGroup& conf ); void defaults(); protected slots: diff --git a/clients/default/config/config.cpp b/clients/default/config/config.cpp index c014edba3c..28d58f09d1 100644 --- a/clients/default/config/config.cpp +++ b/clients/default/config/config.cpp @@ -30,7 +30,7 @@ extern "C" // Configure tab in kwindecoration KDEDefaultConfig::KDEDefaultConfig( KConfig* conf, QWidget* parent ) - : QObject( parent ) + : QObject( parent ),c(conf) { KGlobal::locale()->insertCatalog("kwin_clients"); highcolor = QPixmap::defaultDepth() > 8; @@ -58,7 +58,8 @@ KDEDefaultConfig::KDEDefaultConfig( KConfig* conf, QWidget* parent ) } // Load configuration options - load( conf ); + KConfigGroup cg(c, "KDEDefault"); + load( cg ); // Ensure we track user changes properly connect( cbShowStipple, SIGNAL(clicked()), @@ -88,9 +89,9 @@ void KDEDefaultConfig::slotSelectionChanged() // Loads the configurable options from the kwinrc config file // It is passed the open config from kwindecoration to improve efficiency -void KDEDefaultConfig::load( KConfig* conf ) +void KDEDefaultConfig::load( const KConfigGroup& ) { - KConfigGroup cg(conf, "KDEDefault"); + KConfigGroup cg(c, "KDEDefault"); bool override = cg.readEntry( "ShowTitleBarStipple", true); cbShowStipple->setChecked( override ); @@ -105,9 +106,9 @@ void KDEDefaultConfig::load( KConfig* conf ) // Saves the configurable options to the kwinrc config file -void KDEDefaultConfig::save( KConfig* conf ) +void KDEDefaultConfig::save( KConfigGroup& ) { - KConfigGroup cg(conf, "KDEDefault"); + KConfigGroup cg(c, "KDEDefault"); cg.writeEntry( "ShowTitleBarStipple", cbShowStipple->isChecked() ); cg.writeEntry( "ShowGrabBar", cbShowGrabBar->isChecked() ); diff --git a/clients/default/config/config.h b/clients/default/config/config.h index 787a954676..5cb200b054 100644 --- a/clients/default/config/config.h +++ b/clients/default/config/config.h @@ -29,8 +29,8 @@ class KDEDefaultConfig: public QObject void changed(); public slots: - void load( KConfig* conf ); - void save( KConfig* conf ); + void load( const KConfigGroup& conf ); + void save( KConfigGroup& conf ); void defaults(); protected slots: @@ -41,6 +41,7 @@ class KDEDefaultConfig: public QObject QCheckBox* cbShowGrabBar; QCheckBox* cbUseGradients; KVBox* gb; + KConfig *c; bool highcolor; }; diff --git a/clients/keramik/config/config.cpp b/clients/keramik/config/config.cpp index 05e0731f16..bc0cd6a782 100644 --- a/clients/keramik/config/config.cpp +++ b/clients/keramik/config/config.cpp @@ -53,14 +53,14 @@ KeramikConfig::KeramikConfig( KConfig* conf, QWidget* parent ) { KGlobal::locale()->insertCatalog("kwin_clients"); c = new KConfig( "kwinkeramikrc" ); - + KConfigGroup cg(c, "General"); ui = new KeramikConfigUI( parent ); connect( ui->showAppIcons, SIGNAL(clicked()), SIGNAL(changed()) ); connect( ui->smallCaptions, SIGNAL(clicked()), SIGNAL(changed()) ); connect( ui->largeGrabBars, SIGNAL(clicked()), SIGNAL(changed()) ); connect( ui->useShadowedText, SIGNAL(clicked()), SIGNAL(changed()) ); - load( conf ); + load( cg ); ui->show(); } @@ -74,7 +74,7 @@ KeramikConfig::~KeramikConfig() // Loads the configurable options from the kwinrc config file // It is passed the open config from kwindecoration to improve efficiency -void KeramikConfig::load( KConfig* ) +void KeramikConfig::load( const KConfigGroup& ) { KConfigGroup cg(c, "General"); ui->showAppIcons->setChecked( cg.readEntry("ShowAppIcons", true) ); @@ -85,7 +85,7 @@ void KeramikConfig::load( KConfig* ) // Saves the configurable options to the kwinrc config file -void KeramikConfig::save( KConfig* ) +void KeramikConfig::save( KConfigGroup& ) { KConfigGroup cg(c, "General"); cg.writeEntry( "ShowAppIcons", ui->showAppIcons->isChecked() ); diff --git a/clients/keramik/config/config.h b/clients/keramik/config/config.h index 80dbbbc528..de6db138a7 100644 --- a/clients/keramik/config/config.h +++ b/clients/keramik/config/config.h @@ -52,8 +52,8 @@ class KeramikConfig: public QObject void changed(); public slots: - void load( KConfig* conf ); - void save( KConfig* conf ); + void load( const KConfigGroup& conf ); + void save( KConfigGroup& conf ); void defaults(); private: diff --git a/clients/modernsystem/config/config.cpp b/clients/modernsystem/config/config.cpp index 24ea143f25..435458e7ec 100644 --- a/clients/modernsystem/config/config.cpp +++ b/clients/modernsystem/config/config.cpp @@ -82,7 +82,8 @@ ModernSysConfig::ModernSysConfig(KConfig* conf, QWidget* parent) : QObject(paren layout->addItem(new QSpacerItem(30, 10, QSizePolicy::Fixed, QSizePolicy::Fixed), 1, 0); layout->addWidget(sliderBox, 1, 1); - load(conf); + KConfigGroup group(conf,"General"); + load(group); mainw->show(); } @@ -105,7 +106,7 @@ void ModernSysConfig::slotSelectionChanged() } -void ModernSysConfig::load(KConfig* /*conf*/) +void ModernSysConfig::load(const KConfigGroup& /*conf*/) { KConfigGroup cg(clientrc, "General"); bool i = cg.readEntry("ShowHandle", true); @@ -119,7 +120,7 @@ void ModernSysConfig::load(KConfig* /*conf*/) } -void ModernSysConfig::save(KConfig* /*conf*/) +void ModernSysConfig::save(KConfigGroup& /*conf*/) { KConfigGroup cg(clientrc, "General"); cg.writeEntry("ShowHandle", cbShowHandle->isChecked()); diff --git a/clients/modernsystem/config/config.h b/clients/modernsystem/config/config.h index bde25bfbbd..52d25b3459 100644 --- a/clients/modernsystem/config/config.h +++ b/clients/modernsystem/config/config.h @@ -23,8 +23,8 @@ class ModernSysConfig : public QObject void changed(); public slots: - void load(KConfig* conf); - void save(KConfig* conf); + void load(const KConfigGroup& conf); + void save(KConfigGroup& conf); void defaults(); protected slots: diff --git a/clients/plastik/config/config.cpp b/clients/plastik/config/config.cpp index c4b1ee0d51..496a206d1f 100644 --- a/clients/plastik/config/config.cpp +++ b/clients/plastik/config/config.cpp @@ -38,6 +38,7 @@ PlastikConfig::PlastikConfig(KConfig* config, QWidget* parent) { // create the configuration object m_config = new KConfig("kwinplastikrc"); + KConfigGroup cg(m_config, "General"); KGlobal::locale()->insertCatalog("kwin_clients"); // create and show the configuration dialog @@ -45,7 +46,7 @@ PlastikConfig::PlastikConfig(KConfig* config, QWidget* parent) m_dialog->show(); // load the configuration - load(config); + load(cg); // setup the connections connect(m_dialog->titleAlign, SIGNAL(clicked(int)), @@ -66,7 +67,7 @@ PlastikConfig::~PlastikConfig() delete m_config; } -void PlastikConfig::load(KConfig*) +void PlastikConfig::load(const KConfigGroup&) { KConfigGroup cg(m_config, "General"); @@ -84,7 +85,7 @@ void PlastikConfig::load(KConfig*) m_dialog->coloredBorder->setChecked(coloredBorder); } -void PlastikConfig::save(KConfig*) +void PlastikConfig::save(KConfigGroup&) { KConfigGroup cg(m_config, "General"); diff --git a/clients/plastik/config/config.h b/clients/plastik/config/config.h index 8adaad9609..7bbe6b41b7 100644 --- a/clients/plastik/config/config.h +++ b/clients/plastik/config/config.h @@ -49,8 +49,8 @@ signals: void changed(); public slots: - void load(KConfig *config); - void save(KConfig *config); + void load(const KConfigGroup &config); + void save(KConfigGroup &config); void defaults(); private: diff --git a/clients/quartz/config/config.cpp b/clients/quartz/config/config.cpp index 54aed66cac..0cb86d2094 100644 --- a/clients/quartz/config/config.cpp +++ b/clients/quartz/config/config.cpp @@ -35,6 +35,7 @@ QuartzConfig::QuartzConfig( KConfig* conf, QWidget* parent ) : QObject( parent ) { quartzConfig = new KConfig("kwinquartzrc"); + KConfigGroup cg(quartzConfig, "General"); KGlobal::locale()->insertCatalog("kwin_clients"); gb = new KVBox( parent ); cbColorBorder = new QCheckBox( @@ -47,7 +48,7 @@ QuartzConfig::QuartzConfig( KConfig* conf, QWidget* parent ) cbExtraSmall->setWhatsThis( i18n("Quartz window decorations with extra-small title bar.") ); // Load configuration options - load( conf ); + load( cg ); // Ensure we track user changes properly connect( cbColorBorder, SIGNAL(clicked()), this, SLOT(slotSelectionChanged()) ); @@ -73,7 +74,7 @@ void QuartzConfig::slotSelectionChanged() // Loads the configurable options from the kwinrc config file // It is passed the open config from kwindecoration to improve efficiency -void QuartzConfig::load( KConfig* /*conf*/ ) +void QuartzConfig::load( const KConfigGroup& /*conf*/ ) { KConfigGroup cg(quartzConfig, "General"); bool override = cg.readEntry( "UseTitleBarBorderColors", true); @@ -84,7 +85,7 @@ void QuartzConfig::load( KConfig* /*conf*/ ) // Saves the configurable options to the kwinrc config file -void QuartzConfig::save( KConfig* /*conf*/ ) +void QuartzConfig::save( KConfigGroup& /*conf*/ ) { KConfigGroup cg(quartzConfig, "General"); cg.writeEntry( "UseTitleBarBorderColors", cbColorBorder->isChecked() ); diff --git a/clients/quartz/config/config.h b/clients/quartz/config/config.h index aee43002d2..5ad12fa0dd 100644 --- a/clients/quartz/config/config.h +++ b/clients/quartz/config/config.h @@ -28,8 +28,8 @@ class QuartzConfig: public QObject void changed(); public slots: - void load( KConfig* conf ); - void save( KConfig* conf ); + void load( const KConfigGroup& conf ); + void save( KConfigGroup& conf ); void defaults(); protected slots: diff --git a/kcmkwin/kwindecoration/kwindecoration.cpp b/kcmkwin/kwindecoration/kwindecoration.cpp index 779af351fc..e55c14307a 100644 --- a/kcmkwin/kwindecoration/kwindecoration.cpp +++ b/kcmkwin/kwindecoration/kwindecoration.cpp @@ -418,8 +418,8 @@ void KWinDecorationModule::resetPlugin( KConfigGroup& conf, const QString& curre // connect required signals and slots together... connect( pluginObject, SIGNAL(changed()), this, SLOT(slotSelectionChanged()) ); - connect( this, SIGNAL(pluginLoad(KConfig*)), pluginObject, SLOT(load(KConfig*)) ); - connect( this, SIGNAL(pluginSave(KConfig*)), pluginObject, SLOT(save(KConfig*)) ); + connect( this, SIGNAL(pluginLoad(const KConfigGroup&)), pluginObject, SLOT(load(const KConfigGroup&)) ); + connect( this, SIGNAL(pluginSave(KConfigGroup &)), pluginObject, SLOT(save(KConfigGroup &)) ); connect( this, SIGNAL(pluginDefaults()), pluginObject, SLOT(defaults()) ); pluginConfigWidget->show(); return;