port to KPluginFactory
svn path=/trunk/KDE/kdebase/workspace/; revision=705777icc-effect-5.14.5
parent
ee20630e52
commit
78bec90fbe
|
@ -7,7 +7,6 @@ ServiceTypes=KCModule
|
||||||
DocPath=kcontrol/kwineffects/index.html
|
DocPath=kcontrol/kwineffects/index.html
|
||||||
|
|
||||||
X-KDE-Library=kcm_kwineffects
|
X-KDE-Library=kcm_kwineffects
|
||||||
X-KDE-FactoryName=kcm_kwineffects
|
|
||||||
X-KDE-ParentApp=kcontrol
|
X-KDE-ParentApp=kcontrol
|
||||||
|
|
||||||
X-KDE-System-Settings-Parent-Category=window-behaviour
|
X-KDE-System-Settings-Parent-Category=window-behaviour
|
||||||
|
|
|
@ -10,7 +10,6 @@ License. See the file "COPYING" for the exact licensing terms.
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
#include <kgenericfactory.h>
|
|
||||||
#include <kaboutdata.h>
|
#include <kaboutdata.h>
|
||||||
#include <kconfig.h>
|
#include <kconfig.h>
|
||||||
#include <kdebug.h>
|
#include <kdebug.h>
|
||||||
|
@ -19,22 +18,23 @@ License. See the file "COPYING" for the exact licensing terms.
|
||||||
#include <kplugininfo.h>
|
#include <kplugininfo.h>
|
||||||
#include <kservice.h>
|
#include <kservice.h>
|
||||||
#include <ksettings/dispatcher.h>
|
#include <ksettings/dispatcher.h>
|
||||||
|
#include <KPluginFactory>
|
||||||
|
#include <KPluginLoader>
|
||||||
|
|
||||||
#include <QtDBus/QtDBus>
|
#include <QtDBus/QtDBus>
|
||||||
#include <QBoxLayout>
|
#include <QBoxLayout>
|
||||||
|
|
||||||
|
K_PLUGIN_FACTORY(KWinEffectsConfigFactory,
|
||||||
|
registerPlugin<KWin::KWinEffectsConfig>();
|
||||||
|
)
|
||||||
typedef KGenericFactory<KWin::KWinEffectsConfig> KWinEffectsConfigFactory;
|
K_EXPORT_PLUGIN(KWinEffectsConfigFactory("kcmkwineffects"))
|
||||||
K_EXPORT_COMPONENT_FACTORY( kcm_kwineffects, KWinEffectsConfigFactory("kcmkwineffects"))
|
|
||||||
|
|
||||||
|
|
||||||
namespace KWin
|
namespace KWin
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
KWinEffectsConfig::KWinEffectsConfig(QWidget *parent, const QStringList &)
|
KWinEffectsConfig::KWinEffectsConfig(QWidget *parent, const QVariantList &)
|
||||||
: KCModule( KWinEffectsConfigFactory::componentData(), parent),
|
: KCModule( KWinEffectsConfigFactory::componentData(), parent),
|
||||||
mKWinConfig(KSharedConfig::openConfig("kwinrc"))
|
mKWinConfig(KSharedConfig::openConfig("kwinrc"))
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,9 +12,7 @@ License. See the file "COPYING" for the exact licensing terms.
|
||||||
#ifndef __MAIN_H__
|
#ifndef __MAIN_H__
|
||||||
#define __MAIN_H__
|
#define __MAIN_H__
|
||||||
|
|
||||||
#define KDE3_SUPPORT
|
|
||||||
#include <kcmodule.h>
|
#include <kcmodule.h>
|
||||||
#undef KDE3_SUPPORT
|
|
||||||
|
|
||||||
#include <ksharedconfig.h>
|
#include <ksharedconfig.h>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
|
@ -29,7 +27,7 @@ class KWinEffectsConfig : public KCModule
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
KWinEffectsConfig(QWidget *parent, const QStringList &args);
|
KWinEffectsConfig(QWidget *parent, const QVariantList &args);
|
||||||
virtual ~KWinEffectsConfig();
|
virtual ~KWinEffectsConfig();
|
||||||
|
|
||||||
virtual QString quickHelp() const;
|
virtual QString quickHelp() const;
|
||||||
|
|
|
@ -7,7 +7,7 @@ Exec=kcmshell kwinactions
|
||||||
DocPath=kcontrol/windowmanagement/index.html#action-actions
|
DocPath=kcontrol/windowmanagement/index.html#action-actions
|
||||||
|
|
||||||
X-KDE-Library=kcm_kwinoptions
|
X-KDE-Library=kcm_kwinoptions
|
||||||
X-KDE-FactoryName=kwinactions
|
X-KDE-PluginKeyword=kwinactions
|
||||||
|
|
||||||
Name=Actions
|
Name=Actions
|
||||||
Name[af]=Aksies
|
Name[af]=Aksies
|
||||||
|
|
|
@ -7,7 +7,7 @@ Exec=kcmshell kwinadvanced
|
||||||
DocPath=kcontrol/windowmanagement/index.html#action-advanced
|
DocPath=kcontrol/windowmanagement/index.html#action-advanced
|
||||||
|
|
||||||
X-KDE-Library=kcm_kwinoptions
|
X-KDE-Library=kcm_kwinoptions
|
||||||
X-KDE-FactoryName=kwinadvanced
|
X-KDE-PluginKeyword=kwinadvanced
|
||||||
|
|
||||||
Name=Advanced
|
Name=Advanced
|
||||||
Name[af]=Gevorderde
|
Name[af]=Gevorderde
|
||||||
|
|
|
@ -7,7 +7,7 @@ Exec=kcmshell kwinfocus
|
||||||
DocPath=kcontrol/windowmanagement/index.html#action-focus
|
DocPath=kcontrol/windowmanagement/index.html#action-focus
|
||||||
|
|
||||||
X-KDE-Library=kcm_kwinoptions
|
X-KDE-Library=kcm_kwinoptions
|
||||||
X-KDE-FactoryName=kwinfocus
|
X-KDE-PluginKeyword=kwinfocus
|
||||||
|
|
||||||
Name=Focus
|
Name=Focus
|
||||||
Name[af]=Fokus
|
Name[af]=Fokus
|
||||||
|
|
|
@ -7,7 +7,7 @@ Exec=kcmshell kwinmoving
|
||||||
DocPath=kcontrol/windowmanagement/index.html#action-moving
|
DocPath=kcontrol/windowmanagement/index.html#action-moving
|
||||||
|
|
||||||
X-KDE-Library=kcm_kwinoptions
|
X-KDE-Library=kcm_kwinoptions
|
||||||
X-KDE-FactoryName=kwinmoving
|
X-KDE-PluginKeyword=kwinmoving
|
||||||
|
|
||||||
Name=Moving
|
Name=Moving
|
||||||
Name[af]=Beweeg
|
Name[af]=Beweeg
|
||||||
|
|
|
@ -7,7 +7,7 @@ ServiceTypes=KCModule
|
||||||
DocPath=kcontrol/windowmanagement/index.html
|
DocPath=kcontrol/windowmanagement/index.html
|
||||||
|
|
||||||
X-KDE-Library=kcm_kwinoptions
|
X-KDE-Library=kcm_kwinoptions
|
||||||
X-KDE-FactoryName=kwinoptions
|
X-KDE-PluginKeyword=kwinoptions
|
||||||
X-KDE-ParentApp=kcontrol
|
X-KDE-ParentApp=kcontrol
|
||||||
|
|
||||||
X-KDE-System-Settings-Parent-Category=window-behaviour
|
X-KDE-System-Settings-Parent-Category=window-behaviour
|
||||||
|
|
|
@ -27,58 +27,46 @@
|
||||||
#include <kglobal.h>
|
#include <kglobal.h>
|
||||||
#include <klocale.h>
|
#include <klocale.h>
|
||||||
#include <kconfig.h>
|
#include <kconfig.h>
|
||||||
#include <kgenericfactory.h>
|
|
||||||
#include <kaboutdata.h>
|
#include <kaboutdata.h>
|
||||||
#include <kdialog.h>
|
#include <kdialog.h>
|
||||||
|
#include <KPluginFactory>
|
||||||
|
#include <KPluginLoader>
|
||||||
|
|
||||||
#include "mouse.h"
|
#include "mouse.h"
|
||||||
#include "windows.h"
|
#include "windows.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
static KComponentData *_kcmkwm = 0;
|
K_PLUGIN_FACTORY_DECLARATION(KWinOptionsFactory)
|
||||||
|
|
||||||
inline KComponentData inst() {
|
|
||||||
if (!_kcmkwm) {
|
|
||||||
_kcmkwm = new KComponentData("kcmkwm");
|
|
||||||
}
|
|
||||||
return *_kcmkwm;
|
|
||||||
}
|
|
||||||
|
|
||||||
class KFocusConfigStandalone : public KFocusConfig
|
class KFocusConfigStandalone : public KFocusConfig
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
KFocusConfigStandalone(QWidget* parent, const QStringList &)
|
KFocusConfigStandalone(QWidget* parent, const QVariantList &)
|
||||||
: KFocusConfig(true, new KConfig("kwinrc"), inst(), parent)
|
: KFocusConfig(true, new KConfig("kwinrc"), KWinOptionsFactory::componentData(), parent)
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
typedef KGenericFactory<KFocusConfigStandalone> KFocusConfigFactory;
|
|
||||||
K_EXPORT_COMPONENT_FACTORY(kwinfocus, KFocusConfigFactory)
|
|
||||||
|
|
||||||
class KMovingConfigStandalone : public KMovingConfig
|
class KMovingConfigStandalone : public KMovingConfig
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
KMovingConfigStandalone(QWidget* parent, const QStringList &)
|
KMovingConfigStandalone(QWidget* parent, const QVariantList &)
|
||||||
: KMovingConfig(true, new KConfig("kwinrc"), inst(), parent)
|
: KMovingConfig(true, new KConfig("kwinrc"), KWinOptionsFactory::componentData(), parent)
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
typedef KGenericFactory<KMovingConfigStandalone> KMovingConfigFactory;
|
|
||||||
K_EXPORT_COMPONENT_FACTORY(kwinmoving, KMovingConfigFactory)
|
|
||||||
|
|
||||||
class KAdvancedConfigStandalone : public KAdvancedConfig
|
class KAdvancedConfigStandalone : public KAdvancedConfig
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
KAdvancedConfigStandalone(QWidget* parent, const QStringList &)
|
KAdvancedConfigStandalone(QWidget* parent, const QVariantList &)
|
||||||
: KAdvancedConfig(true, new KConfig("kwinrc"), inst(), parent)
|
: KAdvancedConfig(true, new KConfig("kwinrc"), KWinOptionsFactory::componentData(), parent)
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
typedef KGenericFactory<KAdvancedConfigStandalone> KAdvancedConfigFactory;
|
|
||||||
K_EXPORT_COMPONENT_FACTORY(kwinadvanced, KAdvancedConfigFactory)
|
|
||||||
|
|
||||||
typedef KGenericFactory<KWinOptions> KWinOptionsFactory;
|
KWinOptions::KWinOptions(QWidget *parent, const QVariantList &)
|
||||||
K_EXPORT_COMPONENT_FACTORY(kwinoptions, KWinOptionsFactory)
|
: KCModule(KWinOptionsFactory::componentData(), parent)
|
||||||
|
|
||||||
KWinOptions::KWinOptions(QWidget *parent, const QStringList &)
|
|
||||||
: KCModule(inst(), parent)
|
|
||||||
{
|
{
|
||||||
mConfig = new KConfig( "kwinrc", KConfig::IncludeGlobals );
|
mConfig = new KConfig( "kwinrc", KConfig::IncludeGlobals );
|
||||||
|
|
||||||
|
@ -195,11 +183,8 @@ void KWinOptions::moduleChanged(bool state)
|
||||||
emit KCModule::changed(state);
|
emit KCModule::changed(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef KGenericFactory<KActionsOptions> KActionsOptionsFactory;
|
KActionsOptions::KActionsOptions(QWidget *parent, const QVariantList &)
|
||||||
K_EXPORT_COMPONENT_FACTORY(kwinactions, KActionsOptionsFactory)
|
: KCModule(KWinOptionsFactory::componentData(), parent)
|
||||||
|
|
||||||
KActionsOptions::KActionsOptions(QWidget *parent, const QStringList &)
|
|
||||||
: KCModule(inst(), parent)
|
|
||||||
{
|
{
|
||||||
mConfig = new KConfig( "kwinrc", KConfig::IncludeGlobals );
|
mConfig = new KConfig( "kwinrc", KConfig::IncludeGlobals );
|
||||||
|
|
||||||
|
@ -260,4 +245,14 @@ void KActionsOptions::moduleChanged(bool state)
|
||||||
emit KCModule::changed(state);
|
emit KCModule::changed(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
K_PLUGIN_FACTORY_DEFINITION(KWinOptionsFactory,
|
||||||
|
registerPlugin<KActionsOptions>("kwinactions");
|
||||||
|
registerPlugin<KFocusConfigStandalone>("kwinfocus");
|
||||||
|
registerPlugin<KMovingConfigStandalone>("kwinmoving");
|
||||||
|
registerPlugin<KAdvancedConfigStandalone>("kwinadvanced");
|
||||||
|
registerPlugin<KWinOptions>("kwinoptions");
|
||||||
|
)
|
||||||
|
K_EXPORT_PLUGIN(KWinOptionsFactory("kcmkwm"))
|
||||||
|
|
||||||
#include "main.moc"
|
#include "main.moc"
|
||||||
|
#include "moc_main.cpp"
|
||||||
|
|
|
@ -26,16 +26,13 @@
|
||||||
#define __MAIN_H__
|
#define __MAIN_H__
|
||||||
|
|
||||||
#include <QTabWidget>
|
#include <QTabWidget>
|
||||||
#define KDE3_SUPPORT
|
|
||||||
#include <kcmodule.h>
|
#include <kcmodule.h>
|
||||||
#undef KDE3_SUPPORT
|
|
||||||
|
|
||||||
class KConfig;
|
class KConfig;
|
||||||
class KFocusConfig;
|
class KFocusConfig;
|
||||||
class KTitleBarActionsConfig;
|
class KTitleBarActionsConfig;
|
||||||
class KWindowActionsConfig;
|
class KWindowActionsConfig;
|
||||||
class KAdvancedConfig;
|
class KAdvancedConfig;
|
||||||
class QStringList;
|
|
||||||
|
|
||||||
class KWinOptions : public KCModule
|
class KWinOptions : public KCModule
|
||||||
{
|
{
|
||||||
|
@ -43,7 +40,7 @@ class KWinOptions : public KCModule
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
KWinOptions(QWidget *parent, const QStringList &args);
|
KWinOptions(QWidget *parent, const QVariantList &args);
|
||||||
virtual ~KWinOptions();
|
virtual ~KWinOptions();
|
||||||
|
|
||||||
void load();
|
void load();
|
||||||
|
@ -76,7 +73,7 @@ class KActionsOptions : public KCModule
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
KActionsOptions(QWidget *parent, const QStringList &args);
|
KActionsOptions(QWidget *parent, const QVariantList &args);
|
||||||
virtual ~KActionsOptions();
|
virtual ~KActionsOptions();
|
||||||
|
|
||||||
void load();
|
void load();
|
||||||
|
|
Loading…
Reference in New Issue