diff --git a/kcmkwin/kwinoptions/main.cpp b/kcmkwin/kwinoptions/main.cpp index 3215040d99..0f01433eff 100644 --- a/kcmkwin/kwinoptions/main.cpp +++ b/kcmkwin/kwinoptions/main.cpp @@ -36,57 +36,55 @@ #include "main.h" +static KInstance *_kcmkwm = 0; + +inline KInstance *inst() { + if (_kcmkwm) + return _kcmkwm; + _kcmkwm = new KInstance("kcmkwm"); + return _kcmkwm; +} + + extern "C" { KDE_EXPORT KCModule *create_kwinfocus(QWidget *parent, const char *name) { - //CT there's need for decision: kwm or kwin? - KGlobal::locale()->insertCatalog("kcmkwm"); KConfig *c = new KConfig("kwinrc", false, true); - return new KFocusConfig(true, c, parent, name); + return new KFocusConfig(true, c, inst(), parent); } KDE_EXPORT KCModule *create_kwinactions(QWidget *parent, const char *name) { - //CT there's need for decision: kwm or kwin? - KGlobal::locale()->insertCatalog("kcmkwm"); - return new KActionsOptions( parent, name); + return new KActionsOptions( inst(), parent); } KDE_EXPORT KCModule *create_kwinmoving(QWidget *parent, const char *name) { - //CT there's need for decision: kwm or kwin? - KGlobal::locale()->insertCatalog("kcmkwm"); KConfig *c = new KConfig("kwinrc", false, true); - return new KMovingConfig(true, c, parent, name); + return new KMovingConfig(true, c, inst(), parent); } KDE_EXPORT KCModule *create_kwinadvanced(QWidget *parent, const char *name) { - //CT there's need for decision: kwm or kwin? - KGlobal::locale()->insertCatalog("kcmkwm"); KConfig *c = new KConfig("kwinrc", false, true); - return new KAdvancedConfig(true, c, parent, name); + return new KAdvancedConfig(true, c, inst(), parent); } KDE_EXPORT KCModule *create_kwintranslucency(QWidget *parent, const char *name) { - //CT there's need for decision: kwm or kwin? - KGlobal::locale()->insertCatalog("kcmkwm"); KConfig *c = new KConfig("kwinrc", false, true); - return new KTranslucencyConfig(true, c, parent, name); + return new KTranslucencyConfig(true, c, inst(), parent); } KDE_EXPORT KCModule *create_kwinoptions ( QWidget *parent, const char* name) { - //CT there's need for decision: kwm or kwin? - KGlobal::locale()->insertCatalog("kcmkwm"); - return new KWinOptions( parent, name); + return new KWinOptions( inst(), parent); } } -KWinOptions::KWinOptions(QWidget *parent, const char *name) - : KCModule(parent, name) +KWinOptions::KWinOptions(KInstance *inst, QWidget *parent) + : KCModule(inst, parent) { mConfig = new KConfig("kwinrc", false, true); @@ -94,32 +92,38 @@ KWinOptions::KWinOptions(QWidget *parent, const char *name) tab = new QTabWidget(this); layout->addWidget(tab); - mFocus = new KFocusConfig(false, mConfig, this, "KWin Focus Config"); + mFocus = new KFocusConfig(false, mConfig, inst, this); + mFocus->setObjectName("KWin Focus Config"); mFocus->layout()->setMargin( KDialog::marginHint() ); tab->addTab(mFocus, i18n("&Focus")); connect(mFocus, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); - mTitleBarActions = new KTitleBarActionsConfig(false, mConfig, this, "KWin TitleBar Actions"); + mTitleBarActions = new KTitleBarActionsConfig(false, mConfig, inst, this); + mTitleBarActions->setObjectName("KWin TitleBar Actions"); mTitleBarActions->layout()->setMargin( KDialog::marginHint() ); tab->addTab(mTitleBarActions, i18n("&Titlebar Actions")); connect(mTitleBarActions, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); - mWindowActions = new KWindowActionsConfig(false, mConfig, this, "KWin Window Actions"); + mWindowActions = new KWindowActionsConfig(false, mConfig, inst, this); + mWindowActions->setObjectName("KWin Window Actions"); mWindowActions->layout()->setMargin( KDialog::marginHint() ); tab->addTab(mWindowActions, i18n("Window Actio&ns")); connect(mWindowActions, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); - mMoving = new KMovingConfig(false, mConfig, this, "KWin Moving"); + mMoving = new KMovingConfig(false, mConfig, inst, this); + mMoving->setObjectName("KWin Moving"); mMoving->layout()->setMargin( KDialog::marginHint() ); tab->addTab(mMoving, i18n("&Moving")); connect(mMoving, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); - mAdvanced = new KAdvancedConfig(false, mConfig, this, "KWin Advanced"); + mAdvanced = new KAdvancedConfig(false, mConfig, inst, this); + mAdvanced->setObjectName("KWin Advanced"); mAdvanced->layout()->setMargin( KDialog::marginHint() ); tab->addTab(mAdvanced, i18n("Ad&vanced")); connect(mAdvanced, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); - mTranslucency = new KTranslucencyConfig(false, mConfig, this, "KWin Translucency"); + mTranslucency = new KTranslucencyConfig(false, mConfig, inst, this); + mTranslucency->setObjectName("KWin Translucency"); mTranslucency->layout()->setMargin( KDialog::marginHint() ); tab->addTab(mTranslucency, i18n("&Translucency")); connect(mTranslucency, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); @@ -203,8 +207,8 @@ void KWinOptions::moduleChanged(bool state) } -KActionsOptions::KActionsOptions(QWidget *parent, const char *name) - : KCModule(parent, name) +KActionsOptions::KActionsOptions(KInstance *inst, QWidget *parent) + : KCModule(inst, parent) { mConfig = new KConfig("kwinrc", false, true); @@ -212,12 +216,14 @@ KActionsOptions::KActionsOptions(QWidget *parent, const char *name) tab = new QTabWidget(this); layout->addWidget(tab); - mTitleBarActions = new KTitleBarActionsConfig(false, mConfig, this, "KWin TitleBar Actions"); + mTitleBarActions = new KTitleBarActionsConfig(false, mConfig, inst, this); + mTitleBarActions->setObjectName("KWin TitleBar Actions"); mTitleBarActions->layout()->setMargin( KDialog::marginHint() ); tab->addTab(mTitleBarActions, i18n("&Titlebar Actions")); connect(mTitleBarActions, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); - mWindowActions = new KWindowActionsConfig(false, mConfig, this, "KWin Window Actions"); + mWindowActions = new KWindowActionsConfig(false, mConfig, inst, this); + mWindowActions->setObjectName("KWin Window Actions"); mWindowActions->layout()->setMargin( KDialog::marginHint() ); tab->addTab(mWindowActions, i18n("Window Actio&ns")); connect(mWindowActions, SIGNAL(changed(bool)), this, SLOT(moduleChanged(bool))); diff --git a/kcmkwin/kwinoptions/main.h b/kcmkwin/kwinoptions/main.h index 245667eb5c..8796a5b368 100644 --- a/kcmkwin/kwinoptions/main.h +++ b/kcmkwin/kwinoptions/main.h @@ -41,7 +41,7 @@ class KWinOptions : public KCModule public: - KWinOptions(QWidget *parent, const char *name); + KWinOptions(KInstance *inst, QWidget *parent); virtual ~KWinOptions(); void load(); @@ -75,7 +75,7 @@ class KActionsOptions : public KCModule public: - KActionsOptions(QWidget *parent, const char *name); + KActionsOptions(KInstance *inst, QWidget *parent); virtual ~KActionsOptions(); void load(); diff --git a/kcmkwin/kwinoptions/mouse.cpp b/kcmkwin/kwinoptions/mouse.cpp index c4c3f55d9a..871378ff3c 100644 --- a/kcmkwin/kwinoptions/mouse.cpp +++ b/kcmkwin/kwinoptions/mouse.cpp @@ -135,8 +135,8 @@ void KTitleBarActionsConfig::paletteChanged() } -KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, KConfig *_config, QWidget * parent, const char *) - : KCModule(parent, "kcmkwm"), config(_config), standAlone(_standAlone) +KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, KConfig *_config, KInstance *inst, QWidget * parent) + : KCModule(inst, parent), config(_config), standAlone(_standAlone) { QString strWin1, strWin2, strWin3, strAllKey, strAll1, strAll2, strAll3; QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint()); @@ -587,8 +587,8 @@ void KTitleBarActionsConfig::defaults() } -KWindowActionsConfig::KWindowActionsConfig (bool _standAlone, KConfig *_config, QWidget * parent, const char *) - : KCModule(parent, "kcmkwm"), config(_config), standAlone(_standAlone) +KWindowActionsConfig::KWindowActionsConfig (bool _standAlone, KConfig *_config, KInstance *inst, QWidget * parent) + : KCModule(inst, parent), config(_config), standAlone(_standAlone) { QString strWin1, strWin2, strWin3, strAllKey, strAll1, strAll2, strAll3, strAllW; QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint()); diff --git a/kcmkwin/kwinoptions/mouse.h b/kcmkwin/kwinoptions/mouse.h index 95e24c6549..2d436b44f3 100644 --- a/kcmkwin/kwinoptions/mouse.h +++ b/kcmkwin/kwinoptions/mouse.h @@ -54,7 +54,7 @@ class KTitleBarActionsConfig : public KCModule public: - KTitleBarActionsConfig( bool _standAlone, KConfig *_config, QWidget *parent=0, const char* name=0 ); + KTitleBarActionsConfig( bool _standAlone, KConfig *_config, KInstance *inst, QWidget *parent ); ~KTitleBarActionsConfig( ); void load(); @@ -100,7 +100,7 @@ class KWindowActionsConfig : public KCModule public: - KWindowActionsConfig( bool _standAlone, KConfig *_config, QWidget *parent=0, const char* name=0 ); + KWindowActionsConfig( bool _standAlone, KConfig *_config, KInstance *inst, QWidget *parent ); ~KWindowActionsConfig( ); void load(); diff --git a/kcmkwin/kwinoptions/windows.cpp b/kcmkwin/kwinoptions/windows.cpp index 7eb95af9df..61bc691544 100644 --- a/kcmkwin/kwinoptions/windows.cpp +++ b/kcmkwin/kwinoptions/windows.cpp @@ -104,8 +104,8 @@ KFocusConfig::~KFocusConfig () } // removed the LCD display over the slider - this is not good GUI design :) RNolden 051701 -KFocusConfig::KFocusConfig (bool _standAlone, KConfig *_config, QWidget * parent, const char *) - : KCModule(parent, "kcmkwm"), config(_config), standAlone(_standAlone) +KFocusConfig::KFocusConfig (bool _standAlone, KConfig *_config, KInstance *inst, QWidget * parent) + : KCModule(inst, parent), config(_config), standAlone(_standAlone) { QString wtstr; QBoxLayout *lay = new QVBoxLayout (this, 0, KDialog::spacingHint()); @@ -510,8 +510,8 @@ KAdvancedConfig::~KAdvancedConfig () delete config; } -KAdvancedConfig::KAdvancedConfig (bool _standAlone, KConfig *_config, QWidget *parent, const char *) - : KCModule(parent, "kcmkwm"), config(_config), standAlone(_standAlone) +KAdvancedConfig::KAdvancedConfig (bool _standAlone, KConfig *_config, KInstance *inst, QWidget *parent) + : KCModule(inst, parent), config(_config), standAlone(_standAlone) { QString wtstr; QBoxLayout *lay = new QVBoxLayout (this, 0, KDialog::spacingHint()); @@ -768,8 +768,8 @@ KMovingConfig::~KMovingConfig () delete config; } -KMovingConfig::KMovingConfig (bool _standAlone, KConfig *_config, QWidget *parent, const char *) - : KCModule(parent, "kcmkwm"), config(_config), standAlone(_standAlone) +KMovingConfig::KMovingConfig (bool _standAlone, KConfig *_config, KInstance *inst, QWidget *parent) + : KCModule(inst, parent), config(_config), standAlone(_standAlone) { QString wtstr; QBoxLayout *lay = new QVBoxLayout (this, 0, KDialog::spacingHint()); @@ -1200,8 +1200,8 @@ KTranslucencyConfig::~KTranslucencyConfig () kompmgr->detach(); } -KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, KConfig *_config, QWidget *parent, const char *) - : KCModule(parent, "kcmkwm"), config(_config), standAlone(_standAlone) +KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, KConfig *_config, KInstance *inst, QWidget *parent) + : KCModule(inst, parent), config(_config), standAlone(_standAlone) { kompmgr = 0L; resetKompmgr_ = FALSE; diff --git a/kcmkwin/kwinoptions/windows.h b/kcmkwin/kwinoptions/windows.h index 8cd4203cee..eada9fe57b 100644 --- a/kcmkwin/kwinoptions/windows.h +++ b/kcmkwin/kwinoptions/windows.h @@ -72,7 +72,7 @@ class KFocusConfig : public KCModule { Q_OBJECT public: - KFocusConfig( bool _standAlone, KConfig *_config, QWidget *parent=0, const char* name=0 ); + KFocusConfig( bool _standAlone, KConfig *_config, KInstance *inst, QWidget *parent ); ~KFocusConfig(); void load(); @@ -127,7 +127,7 @@ class KMovingConfig : public KCModule { Q_OBJECT public: - KMovingConfig( bool _standAlone, KConfig *config, QWidget *parent=0, const char* name=0 ); + KMovingConfig( bool _standAlone, KConfig *config, KInstance *inst, QWidget *parent ); ~KMovingConfig(); void load(); @@ -182,7 +182,7 @@ class KAdvancedConfig : public KCModule { Q_OBJECT public: - KAdvancedConfig( bool _standAlone, KConfig *config, QWidget *parent=0, const char* name=0 ); + KAdvancedConfig( bool _standAlone, KConfig *config, KInstance *inst, QWidget *parent ); ~KAdvancedConfig(); void load(); @@ -235,7 +235,7 @@ class KTranslucencyConfig : public KCModule { Q_OBJECT public: - KTranslucencyConfig( bool _standAlone, KConfig *config, QWidget *parent=0, const char* name=0 ); + KTranslucencyConfig( bool _standAlone, KConfig *config, KInstance *inst, QWidget *parent); ~KTranslucencyConfig(); void load(); diff --git a/kcmkwin/kwinrules/kcm.cpp b/kcmkwin/kwinrules/kcm.cpp index e1ebdb1ce6..042364c63e 100644 --- a/kcmkwin/kwinrules/kcm.cpp +++ b/kcmkwin/kwinrules/kcm.cpp @@ -32,16 +32,15 @@ extern "C" KDE_EXPORT KCModule *create_kwinrules( QWidget *parent, const char *name ) { - //CT there's need for decision: kwm or kwin? - KGlobal::locale()->insertCatalog( "kcmkwinrules" ); - return new KWinInternal::KCMRules( parent, name ); + KInstance *inst = new KInstance("kcmkwinrules"); + return new KWinInternal::KCMRules( inst, parent ); } namespace KWinInternal { -KCMRules::KCMRules( QWidget *parent, const char *name ) -: KCModule( parent, name ) +KCMRules::KCMRules( KInstance *inst, QWidget *parent ) +: KCModule( inst, parent ) , config( "kwinrulesrc" ) { QVBoxLayout *layout = new QVBoxLayout( this ); diff --git a/kcmkwin/kwinrules/kcm.h b/kcmkwin/kwinrules/kcm.h index 56ab586ae6..31fa01e05f 100644 --- a/kcmkwin/kwinrules/kcm.h +++ b/kcmkwin/kwinrules/kcm.h @@ -36,7 +36,7 @@ class KCMRules { Q_OBJECT public: - KCMRules( QWidget *parent, const char *name ); + KCMRules( KInstance *inst, QWidget *parent ); virtual void load(); virtual void save(); virtual void defaults();