From 2132b1e0c8297435fdc4942e0d679e2ad812e1ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 2 Dec 2016 20:27:43 +0100 Subject: [PATCH] [effects] Use arg="true" in the kcfg files Summary: By changing all kcfg to have arg="true" we can pass in the same KSharedConfigPtr into all effects. This allows to have fake config in the tests and in the planned effect demo mode. Also it means that we don't have to hardcode the name kwinrc into the files. In the configs - where we cannot access the effectshandler - we use the define KWIN_CONFIG which gets generated based on the compile time arguments. Reviewers: #kwin, #plasma Subscribers: plasma-devel, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D3571 --- .../effects/slidingpopups_test.cpp | 8 +++---- autotests/mock_effectshandler.cpp | 7 +++++++ autotests/mock_effectshandler.h | 2 ++ effects.cpp | 5 +++++ effects.h | 2 ++ effects/blur/blur.cpp | 1 + effects/blur/blur.kcfg | 2 +- effects/blur/blur_config.cpp | 2 ++ effects/coverswitch/coverswitch.cpp | 1 + effects/coverswitch/coverswitch.kcfg | 2 +- effects/coverswitch/coverswitch_config.cpp | 2 ++ effects/cube/cube.cpp | 1 + effects/cube/cube.kcfg | 2 +- effects/cube/cube_config.cpp | 2 ++ effects/cube/cubeslide.cpp | 1 + effects/cube/cubeslide.kcfg | 2 +- effects/cube/cubeslide_config.cpp | 2 ++ effects/desktopgrid/desktopgrid.cpp | 1 + effects/desktopgrid/desktopgrid.kcfg | 2 +- effects/desktopgrid/desktopgrid_config.cpp | 2 ++ effects/diminactive/diminactive.cpp | 1 + effects/diminactive/diminactive.kcfg | 2 +- effects/diminactive/diminactive_config.cpp | 2 ++ effects/fallapart/fallapart.cpp | 1 + effects/fallapart/fallapart.kcfg | 2 +- effects/flipswitch/flipswitch.cpp | 1 + effects/flipswitch/flipswitch.kcfg | 2 +- effects/flipswitch/flipswitch_config.cpp | 2 ++ effects/glide/glide.cpp | 1 + effects/glide/glide.kcfg | 2 +- effects/glide/glide_config.cpp | 2 ++ effects/kscreen/kscreen.cpp | 1 + effects/kscreen/kscreen.kcfg | 2 +- effects/lookingglass/lookingglass.cpp | 1 + effects/lookingglass/lookingglass.kcfg | 2 +- effects/lookingglass/lookingglass_config.cpp | 2 ++ effects/magiclamp/magiclamp.cpp | 1 + effects/magiclamp/magiclamp.kcfg | 2 +- effects/magiclamp/magiclamp_config.cpp | 2 ++ effects/magnifier/magnifier.cpp | 1 + effects/magnifier/magnifier.kcfg | 2 +- effects/magnifier/magnifier_config.cpp | 2 ++ effects/mouseclick/mouseclick.cpp | 1 + effects/mouseclick/mouseclick.kcfg | 2 +- effects/mouseclick/mouseclick_config.cpp | 2 ++ effects/mousemark/mousemark.cpp | 1 + effects/mousemark/mousemark.kcfg | 2 +- effects/mousemark/mousemark_config.cpp | 2 ++ effects/presentwindows/presentwindows.cpp | 1 + effects/presentwindows/presentwindows.kcfg | 2 +- .../presentwindows/presentwindows_config.cpp | 2 ++ effects/resize/resize.cpp | 1 + effects/resize/resize.kcfg | 2 +- effects/resize/resize_config.cpp | 2 ++ effects/sheet/sheet.cpp | 1 + effects/sheet/sheet.kcfg | 2 +- effects/showfps/showfps.cpp | 1 + effects/showfps/showfps.kcfg | 2 +- effects/showfps/showfps_config.cpp | 2 ++ effects/slidingpopups/slidingpopups.cpp | 1 + effects/slidingpopups/slidingpopups.kcfg | 2 +- effects/thumbnailaside/thumbnailaside.cpp | 1 + effects/thumbnailaside/thumbnailaside.kcfg | 2 +- .../thumbnailaside/thumbnailaside_config.cpp | 2 ++ effects/trackmouse/trackmouse.cpp | 1 + effects/trackmouse/trackmouse.kcfg | 2 +- effects/trackmouse/trackmouse_config.cpp | 3 ++- effects/windowgeometry/windowgeometry.cpp | 1 + effects/windowgeometry/windowgeometry.kcfg | 2 +- .../windowgeometry/windowgeometry_config.cpp | 2 ++ effects/wobblywindows/wobblywindows.cpp | 1 + effects/wobblywindows/wobblywindows.kcfg | 2 +- .../wobblywindows/wobblywindows_config.cpp | 2 ++ effects/zoom/zoom.cpp | 1 + effects/zoom/zoom.kcfg | 2 +- effects/zoom/zoom_config.cpp | 2 ++ libkwineffects/CMakeLists.txt | 2 +- libkwineffects/kwineffects.h | 21 +++++++++++++++++++ 78 files changed, 134 insertions(+), 31 deletions(-) diff --git a/autotests/integration/effects/slidingpopups_test.cpp b/autotests/integration/effects/slidingpopups_test.cpp index 254a00e409..dd29b88d20 100644 --- a/autotests/integration/effects/slidingpopups_test.cpp +++ b/autotests/integration/effects/slidingpopups_test.cpp @@ -75,13 +75,13 @@ void SlidingPopupsTest::initTestCase() for (QString name : builtinNames) { plugins.writeEntry(name + QStringLiteral("Enabled"), false); } + KConfigGroup wobblyGroup = config->group("Effect-Wobbly"); + wobblyGroup.writeEntry(QStringLiteral("Settings"), QStringLiteral("Custom")); + wobblyGroup.writeEntry(QStringLiteral("OpenEffect"), true); + wobblyGroup.writeEntry(QStringLiteral("CloseEffect"), true); config->sync(); kwinApp()->setConfig(config); - // TODO: make effects use KWin's config directly - KSharedConfig::openConfig(QStringLiteral(KWIN_CONFIG), KConfig::NoGlobals)->group("Effect-Wobbly").writeEntry(QStringLiteral("Settings"), QStringLiteral("Custom")); - KSharedConfig::openConfig(QStringLiteral(KWIN_CONFIG), KConfig::NoGlobals)->group("Effect-Wobbly").writeEntry(QStringLiteral("OpenEffect"), true); - KSharedConfig::openConfig(QStringLiteral(KWIN_CONFIG), KConfig::NoGlobals)->group("Effect-Wobbly").writeEntry(QStringLiteral("CloseEffect"), true); if (QFile::exists(QStringLiteral("/dev/dri/card0"))) { qputenv("KWIN_COMPOSE", QByteArrayLiteral("O2")); diff --git a/autotests/mock_effectshandler.cpp b/autotests/mock_effectshandler.cpp index 8f3769c80f..95d8b72ec7 100644 --- a/autotests/mock_effectshandler.cpp +++ b/autotests/mock_effectshandler.cpp @@ -23,3 +23,10 @@ MockEffectsHandler::MockEffectsHandler(KWin::CompositingType type) : EffectsHandler(type) { } + + +KSharedConfigPtr MockEffectsHandler::config() const +{ + static const KSharedConfigPtr s_config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); + return s_config; +} diff --git a/autotests/mock_effectshandler.h b/autotests/mock_effectshandler.h index 8b96f18bc7..024455b30d 100644 --- a/autotests/mock_effectshandler.h +++ b/autotests/mock_effectshandler.h @@ -260,6 +260,8 @@ public: } void hideOnScreenMessage(OnScreenMessageHideFlags flags = OnScreenMessageHideFlags()) override { Q_UNUSED(flags)} + KSharedConfigPtr config() const override; + private: bool m_animationsSuported = true; }; diff --git a/effects.cpp b/effects.cpp index 3343cf1f64..7dda141596 100644 --- a/effects.cpp +++ b/effects.cpp @@ -1621,6 +1621,11 @@ void EffectsHandlerImpl::hideOnScreenMessage(OnScreenMessageHideFlags flags) OSD::hide(osdFlags); } +KSharedConfigPtr EffectsHandlerImpl::config() const +{ + return kwinApp()->config(); +} + //**************************************** // EffectWindowImpl //**************************************** diff --git a/effects.h b/effects.h index 24fc9c981c..041afbd7a0 100644 --- a/effects.h +++ b/effects.h @@ -241,6 +241,8 @@ public: void showOnScreenMessage(const QString &message, const QString &iconName = QString()) override; void hideOnScreenMessage(OnScreenMessageHideFlags flags = OnScreenMessageHideFlags()) override; + KSharedConfigPtr config() const override; + Scene *scene() const { return m_scene; } diff --git a/effects/blur/blur.cpp b/effects/blur/blur.cpp index ea68fcba3b..68eabe9e6a 100644 --- a/effects/blur/blur.cpp +++ b/effects/blur/blur.cpp @@ -39,6 +39,7 @@ static const QByteArray s_blurAtomName = QByteArrayLiteral("_KDE_NET_WM_BLUR_BEH BlurEffect::BlurEffect() { + initConfig(); shader = BlurShader::create(); m_simpleShader = ShaderManager::instance()->generateShaderFromResources(ShaderTrait::MapTexture, QString(), QStringLiteral("logout-blur.frag")); if (!m_simpleShader->isValid()) { diff --git a/effects/blur/blur.kcfg b/effects/blur/blur.kcfg index 282b175532..6fd2e98c42 100644 --- a/effects/blur/blur.kcfg +++ b/effects/blur/blur.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 12 diff --git a/effects/blur/blur_config.cpp b/effects/blur/blur_config.cpp index f584ceb73a..a39882a723 100644 --- a/effects/blur/blur_config.cpp +++ b/effects/blur/blur_config.cpp @@ -20,6 +20,7 @@ #include "blur_config.h" // KConfigSkeleton #include "blurconfig.h" +#include #include #include @@ -36,6 +37,7 @@ BlurEffectConfig::BlurEffectConfig(QWidget *parent, const QVariantList &args) : KCModule(KAboutData::pluginData(QStringLiteral("blur")), parent, args) { ui.setupUi(this); + BlurConfig::instance(KWIN_CONFIG); addConfig(BlurConfig::self(), this); load(); diff --git a/effects/coverswitch/coverswitch.cpp b/effects/coverswitch/coverswitch.cpp index b6bf9eebbd..b2c26c41f6 100644 --- a/effects/coverswitch/coverswitch.cpp +++ b/effects/coverswitch/coverswitch.cpp @@ -54,6 +54,7 @@ CoverSwitchEffect::CoverSwitchEffect() , primaryTabBox(false) , secondaryTabBox(false) { + initConfig(); reconfigure(ReconfigureAll); // Caption frame diff --git a/effects/coverswitch/coverswitch.kcfg b/effects/coverswitch/coverswitch.kcfg index 9c2d6fd8d6..77db6d29b6 100644 --- a/effects/coverswitch/coverswitch.kcfg +++ b/effects/coverswitch/coverswitch.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 0 diff --git a/effects/coverswitch/coverswitch_config.cpp b/effects/coverswitch/coverswitch_config.cpp index 8410cce3ad..dbb08566f7 100644 --- a/effects/coverswitch/coverswitch_config.cpp +++ b/effects/coverswitch/coverswitch_config.cpp @@ -20,6 +20,7 @@ along with this program. If not, see . #include "coverswitch_config.h" // KConfigSkeleton #include "coverswitchconfig.h" +#include #include #include @@ -48,6 +49,7 @@ CoverSwitchEffectConfig::CoverSwitchEffectConfig(QWidget* parent, const QVariant layout->addWidget(m_ui); + CoverSwitchConfig::instance(KWIN_CONFIG); addConfig(CoverSwitchConfig::self(), m_ui); } diff --git a/effects/cube/cube.cpp b/effects/cube/cube.cpp index 335651c73a..46ba7d62d8 100644 --- a/effects/cube/cube.cpp +++ b/effects/cube/cube.cpp @@ -95,6 +95,7 @@ CubeEffect::CubeEffect() , m_cylinderAction(new QAction(this)) , m_sphereAction(new QAction(this)) { + initConfig(); desktopNameFont.setBold(true); desktopNameFont.setPointSize(14); diff --git a/effects/cube/cube.kcfg b/effects/cube/cube.kcfg index 1b14d976b0..f0c5fda7ec 100644 --- a/effects/cube/cube.kcfg +++ b/effects/cube/cube.kcfg @@ -4,7 +4,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + diff --git a/effects/cube/cube_config.cpp b/effects/cube/cube_config.cpp index 0939b67254..422506dd92 100644 --- a/effects/cube/cube_config.cpp +++ b/effects/cube/cube_config.cpp @@ -20,6 +20,7 @@ along with this program. If not, see . #include "cube_config.h" // KConfigSkeleton #include "cubeconfig.h" +#include #include #include @@ -85,6 +86,7 @@ CubeEffectConfig::CubeEffectConfig(QWidget* parent, const QVariantList& args) : capsSelectionChanged(); connect(m_ui->kcfg_Caps, SIGNAL(stateChanged(int)), this, SLOT(capsSelectionChanged())); m_ui->kcfg_Wallpaper->setFilter(QStringLiteral("*.png *.jpeg *.jpg ")); + CubeConfig::instance(KWIN_CONFIG); addConfig(CubeConfig::self(), m_ui); load(); } diff --git a/effects/cube/cubeslide.cpp b/effects/cube/cubeslide.cpp index 8570620570..3d4db31516 100644 --- a/effects/cube/cubeslide.cpp +++ b/effects/cube/cubeslide.cpp @@ -37,6 +37,7 @@ CubeSlideEffect::CubeSlideEffect() , desktopChangedWhileMoving(false) , progressRestriction(0.0f) { + initConfig(); connect(effects, SIGNAL(desktopChanged(int,int)), this, SLOT(slotDesktopChanged(int,int))); connect(effects, SIGNAL(windowStepUserMovedResized(KWin::EffectWindow*,QRect)), this, SLOT(slotWindowStepUserMovedResized(KWin::EffectWindow*))); connect(effects, SIGNAL(windowFinishUserMovedResized(KWin::EffectWindow*)), this, SLOT(slotWindowFinishUserMovedResized(KWin::EffectWindow*))); diff --git a/effects/cube/cubeslide.kcfg b/effects/cube/cubeslide.kcfg index 03f6eb53db..3a6f2cbd88 100644 --- a/effects/cube/cubeslide.kcfg +++ b/effects/cube/cubeslide.kcfg @@ -4,7 +4,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 0 diff --git a/effects/cube/cubeslide_config.cpp b/effects/cube/cubeslide_config.cpp index de550e37e2..3d7835618c 100644 --- a/effects/cube/cubeslide_config.cpp +++ b/effects/cube/cubeslide_config.cpp @@ -20,6 +20,7 @@ along with this program. If not, see . #include "cubeslide_config.h" // KConfigSkeleton #include "cubeslideconfig.h" +#include #include #include @@ -48,6 +49,7 @@ CubeSlideEffectConfig::CubeSlideEffectConfig(QWidget* parent, const QVariantList layout->addWidget(m_ui); + CubeSlideConfig::instance(KWIN_CONFIG); addConfig(CubeSlideConfig::self(), m_ui); load(); diff --git a/effects/desktopgrid/desktopgrid.cpp b/effects/desktopgrid/desktopgrid.cpp index 79afba03a4..13c2d761e3 100644 --- a/effects/desktopgrid/desktopgrid.cpp +++ b/effects/desktopgrid/desktopgrid.cpp @@ -66,6 +66,7 @@ DesktopGridEffect::DesktopGridEffect() , m_proxy(0) , m_activateAction(new QAction(this)) { + initConfig(); // Load shortcuts QAction* a = m_activateAction; a->setObjectName(QStringLiteral("ShowDesktopGrid")); diff --git a/effects/desktopgrid/desktopgrid.kcfg b/effects/desktopgrid/desktopgrid.kcfg index 7843287c4c..720924d8e8 100644 --- a/effects/desktopgrid/desktopgrid.kcfg +++ b/effects/desktopgrid/desktopgrid.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + diff --git a/effects/desktopgrid/desktopgrid_config.cpp b/effects/desktopgrid/desktopgrid_config.cpp index 54aff9dfb1..3b175359ef 100644 --- a/effects/desktopgrid/desktopgrid_config.cpp +++ b/effects/desktopgrid/desktopgrid_config.cpp @@ -22,6 +22,7 @@ along with this program. If not, see . #include "desktopgrid_config.h" // KConfigSkeleton #include "desktopgridconfig.h" +#include #include #include @@ -83,6 +84,7 @@ DesktopGridEffectConfig::DesktopGridEffectConfig(QWidget* parent, const QVariant m_ui->desktopNameAlignmentCombo->addItem(i18n("Top-Left"), QVariant(Qt::AlignLeft | Qt::AlignTop)); m_ui->desktopNameAlignmentCombo->addItem(i18n("Center"), QVariant(Qt::AlignCenter)); + DesktopGridConfig::instance(KWIN_CONFIG); addConfig(DesktopGridConfig::self(), m_ui); connect(m_ui->kcfg_LayoutMode, SIGNAL(currentIndexChanged(int)), this, SLOT(layoutSelectionChanged())); connect(m_ui->desktopNameAlignmentCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(changed())); diff --git a/effects/diminactive/diminactive.cpp b/effects/diminactive/diminactive.cpp index a04622c210..90eb9ddcb0 100644 --- a/effects/diminactive/diminactive.cpp +++ b/effects/diminactive/diminactive.cpp @@ -30,6 +30,7 @@ namespace KWin DimInactiveEffect::DimInactiveEffect() { + initConfig(); reconfigure(ReconfigureAll); timeline.setDuration(animationTime(250)); previousActiveTimeline.setDuration(animationTime(250)); diff --git a/effects/diminactive/diminactive.kcfg b/effects/diminactive/diminactive.kcfg index 2b6bbba9bb..f1f32fe627 100644 --- a/effects/diminactive/diminactive.kcfg +++ b/effects/diminactive/diminactive.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 25 diff --git a/effects/diminactive/diminactive_config.cpp b/effects/diminactive/diminactive_config.cpp index 799275b6e3..66f7bda445 100644 --- a/effects/diminactive/diminactive_config.cpp +++ b/effects/diminactive/diminactive_config.cpp @@ -21,6 +21,7 @@ along with this program. If not, see . #include "diminactive_config.h" // KConfigSkeleton #include "diminactiveconfig.h" +#include #include @@ -53,6 +54,7 @@ DimInactiveEffectConfig::DimInactiveEffectConfig(QWidget* parent, const QVariant layout->addWidget(m_ui); + DimInactiveConfig::instance(KWIN_CONFIG); addConfig(DimInactiveConfig::self(), m_ui); load(); diff --git a/effects/fallapart/fallapart.cpp b/effects/fallapart/fallapart.cpp index 011b131f7c..08cddcc2f1 100644 --- a/effects/fallapart/fallapart.cpp +++ b/effects/fallapart/fallapart.cpp @@ -34,6 +34,7 @@ bool FallApartEffect::supported() FallApartEffect::FallApartEffect() { + initConfig(); reconfigure(ReconfigureAll); connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*))); connect(effects, SIGNAL(windowDeleted(KWin::EffectWindow*)), this, SLOT(slotWindowDeleted(KWin::EffectWindow*))); diff --git a/effects/fallapart/fallapart.kcfg b/effects/fallapart/fallapart.kcfg index 5f531857f9..57221a1c2b 100644 --- a/effects/fallapart/fallapart.kcfg +++ b/effects/fallapart/fallapart.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 40 diff --git a/effects/flipswitch/flipswitch.cpp b/effects/flipswitch/flipswitch.cpp index 01062a9993..5337979462 100644 --- a/effects/flipswitch/flipswitch.cpp +++ b/effects/flipswitch/flipswitch.cpp @@ -48,6 +48,7 @@ FlipSwitchEffect::FlipSwitchEffect() , m_hasKeyboardGrab(false) , m_captionFrame(NULL) { + initConfig(); reconfigure(ReconfigureAll); // Caption frame diff --git a/effects/flipswitch/flipswitch.kcfg b/effects/flipswitch/flipswitch.kcfg index da6fb62a9f..37c2e75998 100644 --- a/effects/flipswitch/flipswitch.kcfg +++ b/effects/flipswitch/flipswitch.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + false diff --git a/effects/flipswitch/flipswitch_config.cpp b/effects/flipswitch/flipswitch_config.cpp index 4c6ba239e6..f53f5cc1a2 100644 --- a/effects/flipswitch/flipswitch_config.cpp +++ b/effects/flipswitch/flipswitch_config.cpp @@ -20,6 +20,7 @@ along with this program. If not, see . #include "flipswitch_config.h" // KConfigSkeleton #include "flipswitchconfig.h" +#include #include #include @@ -69,6 +70,7 @@ FlipSwitchEffectConfig::FlipSwitchEffectConfig(QWidget* parent, const QVariantLi m_ui->shortcutEditor->addCollection(m_actionCollection); + FlipSwitchConfig::instance(KWIN_CONFIG); addConfig(FlipSwitchConfig::self(), m_ui); load(); diff --git a/effects/glide/glide.cpp b/effects/glide/glide.cpp index dfd63c2c3b..1de4c3953b 100644 --- a/effects/glide/glide.cpp +++ b/effects/glide/glide.cpp @@ -36,6 +36,7 @@ static const int IsGlideWindow = 0x22A982D4; GlideEffect::GlideEffect() : Effect() { + initConfig(); reconfigure(ReconfigureAll); connect(effects, SIGNAL(windowAdded(KWin::EffectWindow*)), this, SLOT(slotWindowAdded(KWin::EffectWindow*))); connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*))); diff --git a/effects/glide/glide.kcfg b/effects/glide/glide.kcfg index a3fd1124e3..0147c5bdd8 100644 --- a/effects/glide/glide.kcfg +++ b/effects/glide/glide.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 0 diff --git a/effects/glide/glide_config.cpp b/effects/glide/glide_config.cpp index 3847db3a37..b7f1c7380e 100644 --- a/effects/glide/glide_config.cpp +++ b/effects/glide/glide_config.cpp @@ -21,6 +21,7 @@ #include "glide_config.h" // KConfigSkeleton #include "glideconfig.h" +#include #include #include @@ -37,6 +38,7 @@ GlideEffectConfig::GlideEffectConfig(QWidget *parent, const QVariantList &args) : KCModule(KAboutData::pluginData(QStringLiteral("glide")), parent, args) { ui.setupUi(this); + GlideConfig::instance(KWIN_CONFIG); addConfig(GlideConfig::self(), this); load(); } diff --git a/effects/kscreen/kscreen.cpp b/effects/kscreen/kscreen.cpp index 67f4551c98..e70498b510 100644 --- a/effects/kscreen/kscreen.cpp +++ b/effects/kscreen/kscreen.cpp @@ -55,6 +55,7 @@ KscreenEffect::KscreenEffect() , m_state(StateNormal) , m_atom(effects->announceSupportProperty("_KDE_KWIN_KSCREEN_SUPPORT", this)) { + initConfig(); connect(effects, SIGNAL(propertyNotify(KWin::EffectWindow*,long)), SLOT(propertyNotify(KWin::EffectWindow*,long))); reconfigure(ReconfigureAll); } diff --git a/effects/kscreen/kscreen.kcfg b/effects/kscreen/kscreen.kcfg index 41232357aa..9aebc063b4 100644 --- a/effects/kscreen/kscreen.kcfg +++ b/effects/kscreen/kscreen.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 0 diff --git a/effects/lookingglass/lookingglass.cpp b/effects/lookingglass/lookingglass.cpp index 62ef1ba65d..f275cd8e56 100644 --- a/effects/lookingglass/lookingglass.cpp +++ b/effects/lookingglass/lookingglass.cpp @@ -52,6 +52,7 @@ LookingGlassEffect::LookingGlassEffect() , m_enabled(false) , m_valid(false) { + initConfig(); QAction* a; a = KStandardAction::zoomIn(this, SLOT(zoomIn()), this); KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_Equal); diff --git a/effects/lookingglass/lookingglass.kcfg b/effects/lookingglass/lookingglass.kcfg index d3c4d71d03..236befdcae 100644 --- a/effects/lookingglass/lookingglass.kcfg +++ b/effects/lookingglass/lookingglass.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 200 diff --git a/effects/lookingglass/lookingglass_config.cpp b/effects/lookingglass/lookingglass_config.cpp index 84be484ed1..7b2de554d6 100644 --- a/effects/lookingglass/lookingglass_config.cpp +++ b/effects/lookingglass/lookingglass_config.cpp @@ -22,6 +22,7 @@ along with this program. If not, see . // KConfigSkeleton #include "lookingglassconfig.h" +#include #include #include @@ -58,6 +59,7 @@ LookingGlassEffectConfig::LookingGlassEffectConfig(QWidget* parent, const QVaria layout->addWidget(m_ui); + LookingGlassConfig::instance(KWIN_CONFIG); addConfig(LookingGlassConfig::self(), m_ui); connect(m_ui->editor, SIGNAL(keyChange()), this, SLOT(changed())); diff --git a/effects/magiclamp/magiclamp.cpp b/effects/magiclamp/magiclamp.cpp index 0a4b0e5bca..a392d49422 100644 --- a/effects/magiclamp/magiclamp.cpp +++ b/effects/magiclamp/magiclamp.cpp @@ -34,6 +34,7 @@ namespace KWin MagicLampEffect::MagicLampEffect() { + initConfig(); mActiveAnimations = 0; reconfigure(ReconfigureAll); connect(effects, SIGNAL(windowDeleted(KWin::EffectWindow*)), this, SLOT(slotWindowDeleted(KWin::EffectWindow*))); diff --git a/effects/magiclamp/magiclamp.kcfg b/effects/magiclamp/magiclamp.kcfg index 4bc0e4f964..67c8ba0c14 100644 --- a/effects/magiclamp/magiclamp.kcfg +++ b/effects/magiclamp/magiclamp.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 0 diff --git a/effects/magiclamp/magiclamp_config.cpp b/effects/magiclamp/magiclamp_config.cpp index 51795eba08..197211643f 100644 --- a/effects/magiclamp/magiclamp_config.cpp +++ b/effects/magiclamp/magiclamp_config.cpp @@ -20,6 +20,7 @@ along with this program. If not, see . #include "magiclamp_config.h" // KConfigSkeleton #include "magiclampconfig.h" +#include #include @@ -50,6 +51,7 @@ MagicLampEffectConfig::MagicLampEffectConfig(QWidget* parent, const QVariantList layout->addWidget(m_ui); + MagicLampConfig::instance(KWIN_CONFIG); addConfig(MagicLampConfig::self(), m_ui); load(); diff --git a/effects/magnifier/magnifier.cpp b/effects/magnifier/magnifier.cpp index 027b49ca40..9768f8d44d 100644 --- a/effects/magnifier/magnifier.cpp +++ b/effects/magnifier/magnifier.cpp @@ -50,6 +50,7 @@ MagnifierEffect::MagnifierEffect() , m_pixmap(XCB_PIXMAP_NONE) #endif { + initConfig(); QAction* a; a = KStandardAction::zoomIn(this, SLOT(zoomIn()), this); KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_Equal); diff --git a/effects/magnifier/magnifier.kcfg b/effects/magnifier/magnifier.kcfg index 8c36ce6637..85e08a14e4 100644 --- a/effects/magnifier/magnifier.kcfg +++ b/effects/magnifier/magnifier.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 200 diff --git a/effects/magnifier/magnifier_config.cpp b/effects/magnifier/magnifier_config.cpp index 167efeb01e..61f4ae9976 100644 --- a/effects/magnifier/magnifier_config.cpp +++ b/effects/magnifier/magnifier_config.cpp @@ -21,6 +21,7 @@ along with this program. If not, see . #include "magnifier_config.h" // KConfigSkeleton #include "magnifierconfig.h" +#include #include #include @@ -57,6 +58,7 @@ MagnifierEffectConfig::MagnifierEffectConfig(QWidget* parent, const QVariantList layout->addWidget(m_ui); + MagnifierConfig::instance(KWIN_CONFIG); addConfig(MagnifierConfig::self(), m_ui); connect(m_ui->editor, SIGNAL(keyChange()), this, SLOT(changed())); diff --git a/effects/mouseclick/mouseclick.cpp b/effects/mouseclick/mouseclick.cpp index 83a0caafeb..e15c46b030 100644 --- a/effects/mouseclick/mouseclick.cpp +++ b/effects/mouseclick/mouseclick.cpp @@ -43,6 +43,7 @@ namespace KWin MouseClickEffect::MouseClickEffect() { + initConfig(); m_enabled = false; QAction* a = new QAction(this); diff --git a/effects/mouseclick/mouseclick.kcfg b/effects/mouseclick/mouseclick.kcfg index b34f072472..64b39b3f68 100644 --- a/effects/mouseclick/mouseclick.kcfg +++ b/effects/mouseclick/mouseclick.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + QColor(Qt::red) diff --git a/effects/mouseclick/mouseclick_config.cpp b/effects/mouseclick/mouseclick_config.cpp index 9d75bffba4..ba516e25b8 100644 --- a/effects/mouseclick/mouseclick_config.cpp +++ b/effects/mouseclick/mouseclick_config.cpp @@ -21,6 +21,7 @@ along with this program. If not, see . #include "mouseclick_config.h" // KConfigSkeleton #include "mouseclickconfig.h" +#include #include #include @@ -67,6 +68,7 @@ MouseClickEffectConfig::MouseClickEffectConfig(QWidget* parent, const QVariantLi m_ui->editor->addCollection(m_actionCollection); + MouseClickConfig::instance(KWIN_CONFIG); addConfig(MouseClickConfig::self(), m_ui); load(); } diff --git a/effects/mousemark/mousemark.cpp b/effects/mousemark/mousemark.cpp index 12c6e9ceb0..f18d42f99c 100644 --- a/effects/mousemark/mousemark.cpp +++ b/effects/mousemark/mousemark.cpp @@ -46,6 +46,7 @@ namespace KWin MouseMarkEffect::MouseMarkEffect() { + initConfig(); QAction* a = new QAction(this); a->setObjectName(QStringLiteral("ClearMouseMarks")); a->setText(i18n("Clear All Mouse Marks")); diff --git a/effects/mousemark/mousemark.kcfg b/effects/mousemark/mousemark.kcfg index c1a9d0c730..ebaf9ac43f 100644 --- a/effects/mousemark/mousemark.kcfg +++ b/effects/mousemark/mousemark.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 3 diff --git a/effects/mousemark/mousemark_config.cpp b/effects/mousemark/mousemark_config.cpp index 68164a071b..158a3ae2e5 100644 --- a/effects/mousemark/mousemark_config.cpp +++ b/effects/mousemark/mousemark_config.cpp @@ -22,6 +22,7 @@ along with this program. If not, see . // KConfigSkeleton #include "mousemarkconfig.h" +#include #include #include @@ -58,6 +59,7 @@ MouseMarkEffectConfig::MouseMarkEffectConfig(QWidget* parent, const QVariantList layout->addWidget(m_ui); + MouseMarkConfig::instance(KWIN_CONFIG); addConfig(MouseMarkConfig::self(), m_ui); // Shortcut config. The shortcut belongs to the component "kwin"! diff --git a/effects/presentwindows/presentwindows.cpp b/effects/presentwindows/presentwindows.cpp index 980b56ea02..7ec058263a 100755 --- a/effects/presentwindows/presentwindows.cpp +++ b/effects/presentwindows/presentwindows.cpp @@ -65,6 +65,7 @@ PresentWindowsEffect::PresentWindowsEffect() , m_exposeAllAction(new QAction(this)) , m_exposeClassAction(new QAction(this)) { + initConfig(); m_atomDesktop = effects->announceSupportProperty("_KDE_PRESENT_WINDOWS_DESKTOP", this); m_atomWindows = effects->announceSupportProperty("_KDE_PRESENT_WINDOWS_GROUP", this); diff --git a/effects/presentwindows/presentwindows.kcfg b/effects/presentwindows/presentwindows.kcfg index 1ef7c312f0..e8bfc703ed 100644 --- a/effects/presentwindows/presentwindows.kcfg +++ b/effects/presentwindows/presentwindows.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 0 diff --git a/effects/presentwindows/presentwindows_config.cpp b/effects/presentwindows/presentwindows_config.cpp index 5ae78cb3d7..fe383765da 100644 --- a/effects/presentwindows/presentwindows_config.cpp +++ b/effects/presentwindows/presentwindows_config.cpp @@ -22,6 +22,7 @@ along with this program. If not, see . #include "presentwindows_config.h" // KConfigSkeleton #include "presentwindowsconfig.h" +#include #include #include @@ -84,6 +85,7 @@ PresentWindowsEffectConfig::PresentWindowsEffectConfig(QWidget* parent, const QV connect(m_ui->shortcutEditor, SIGNAL(keyChange()), this, SLOT(changed())); + PresentWindowsConfig::instance(KWIN_CONFIG); addConfig(PresentWindowsConfig::self(), m_ui); load(); diff --git a/effects/resize/resize.cpp b/effects/resize/resize.cpp index 9ceb250e21..bec9340871 100644 --- a/effects/resize/resize.cpp +++ b/effects/resize/resize.cpp @@ -40,6 +40,7 @@ ResizeEffect::ResizeEffect() , m_active(false) , m_resizeWindow(0) { + initConfig(); reconfigure(ReconfigureAll); connect(effects, SIGNAL(windowStartUserMovedResized(KWin::EffectWindow*)), this, SLOT(slotWindowStartUserMovedResized(KWin::EffectWindow*))); connect(effects, SIGNAL(windowStepUserMovedResized(KWin::EffectWindow*,QRect)), this, SLOT(slotWindowStepUserMovedResized(KWin::EffectWindow*,QRect))); diff --git a/effects/resize/resize.kcfg b/effects/resize/resize.kcfg index 1212f4a114..a02a1660ad 100644 --- a/effects/resize/resize.kcfg +++ b/effects/resize/resize.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + true diff --git a/effects/resize/resize_config.cpp b/effects/resize/resize_config.cpp index 96ee9a8f8a..647a5dfdae 100644 --- a/effects/resize/resize_config.cpp +++ b/effects/resize/resize_config.cpp @@ -20,6 +20,7 @@ along with this program. If not, see . #include "resize_config.h" // KConfigSkeleton #include "resizeconfig.h" +#include #include #include @@ -49,6 +50,7 @@ ResizeEffectConfig::ResizeEffectConfig(QWidget* parent, const QVariantList& args layout->addWidget(m_ui); + ResizeConfig::instance(KWIN_CONFIG); addConfig(ResizeConfig::self(), m_ui); load(); diff --git a/effects/sheet/sheet.cpp b/effects/sheet/sheet.cpp index 84c1bc3393..463e25391c 100644 --- a/effects/sheet/sheet.cpp +++ b/effects/sheet/sheet.cpp @@ -35,6 +35,7 @@ static const int IsSheetWindow = 0x22A982D5; SheetEffect::SheetEffect() { + initConfig(); reconfigure(ReconfigureAll); connect(effects, SIGNAL(windowAdded(KWin::EffectWindow*)), this, SLOT(slotWindowAdded(KWin::EffectWindow*))); connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*))); diff --git a/effects/sheet/sheet.kcfg b/effects/sheet/sheet.kcfg index 17c4bba6b8..25574a5ac6 100644 --- a/effects/sheet/sheet.kcfg +++ b/effects/sheet/sheet.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 0 diff --git a/effects/showfps/showfps.cpp b/effects/showfps/showfps.cpp index 5342f20e85..f95fb5e9d9 100644 --- a/effects/showfps/showfps.cpp +++ b/effects/showfps/showfps.cpp @@ -47,6 +47,7 @@ ShowFpsEffect::ShowFpsEffect() , frames_pos(0) , m_noBenchmark(effects->effectFrame(EffectFrameUnstyled, false)) { + initConfig(); for (int i = 0; i < NUM_PAINTS; ++i) { diff --git a/effects/showfps/showfps.kcfg b/effects/showfps/showfps.kcfg index 33a95c13a1..b0cd4633b9 100644 --- a/effects/showfps/showfps.kcfg +++ b/effects/showfps/showfps.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 0 diff --git a/effects/showfps/showfps_config.cpp b/effects/showfps/showfps_config.cpp index 1fa2af087c..ae89083b11 100644 --- a/effects/showfps/showfps_config.cpp +++ b/effects/showfps/showfps_config.cpp @@ -22,6 +22,7 @@ along with this program. If not, see . // KConfigSkeleton #include "showfpsconfig.h" +#include #include #include @@ -41,6 +42,7 @@ ShowFpsEffectConfig::ShowFpsEffectConfig(QWidget* parent, const QVariantList& ar m_ui = new Ui::ShowFpsEffectConfigForm; m_ui->setupUi(this); + ShowFpsConfig::instance(KWIN_CONFIG); addConfig(ShowFpsConfig::self(), this); load(); diff --git a/effects/slidingpopups/slidingpopups.cpp b/effects/slidingpopups/slidingpopups.cpp index 483dddedae..60004acc0f 100644 --- a/effects/slidingpopups/slidingpopups.cpp +++ b/effects/slidingpopups/slidingpopups.cpp @@ -33,6 +33,7 @@ namespace KWin SlidingPopupsEffect::SlidingPopupsEffect() { + initConfig(); KWayland::Server::Display *display = effects->waylandDisplay(); if (display) { display->createSlideManager(this)->create(); diff --git a/effects/slidingpopups/slidingpopups.kcfg b/effects/slidingpopups/slidingpopups.kcfg index 414cf18a79..aa0a3ad3bd 100644 --- a/effects/slidingpopups/slidingpopups.kcfg +++ b/effects/slidingpopups/slidingpopups.kcfg @@ -4,7 +4,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 0 diff --git a/effects/thumbnailaside/thumbnailaside.cpp b/effects/thumbnailaside/thumbnailaside.cpp index 9c7106a647..2e58ea9b7c 100644 --- a/effects/thumbnailaside/thumbnailaside.cpp +++ b/effects/thumbnailaside/thumbnailaside.cpp @@ -32,6 +32,7 @@ namespace KWin ThumbnailAsideEffect::ThumbnailAsideEffect() { + initConfig(); QAction* a = new QAction(this); a->setObjectName(QStringLiteral("ToggleCurrentThumbnail")); a->setText(i18n("Toggle Thumbnail for Current Window")); diff --git a/effects/thumbnailaside/thumbnailaside.kcfg b/effects/thumbnailaside/thumbnailaside.kcfg index f9cd26e304..a44fb55649 100644 --- a/effects/thumbnailaside/thumbnailaside.kcfg +++ b/effects/thumbnailaside/thumbnailaside.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 200 diff --git a/effects/thumbnailaside/thumbnailaside_config.cpp b/effects/thumbnailaside/thumbnailaside_config.cpp index c6f8d7e002..05125691a7 100644 --- a/effects/thumbnailaside/thumbnailaside_config.cpp +++ b/effects/thumbnailaside/thumbnailaside_config.cpp @@ -21,6 +21,7 @@ along with this program. If not, see . #include "thumbnailaside_config.h" // KConfigSkeleton #include "thumbnailasideconfig.h" +#include #include #include @@ -58,6 +59,7 @@ ThumbnailAsideEffectConfig::ThumbnailAsideEffectConfig(QWidget* parent, const QV connect(m_ui->editor, SIGNAL(keyChange()), this, SLOT(changed())); + ThumbnailAsideConfig::instance(KWIN_CONFIG); addConfig(ThumbnailAsideConfig::self(), this); // Shortcut config. The shortcut belongs to the component "kwin"! diff --git a/effects/trackmouse/trackmouse.cpp b/effects/trackmouse/trackmouse.cpp index b32209e46c..c9fa60f3e5 100644 --- a/effects/trackmouse/trackmouse.cpp +++ b/effects/trackmouse/trackmouse.cpp @@ -45,6 +45,7 @@ TrackMouseEffect::TrackMouseEffect() : m_active(false) , m_angle(0) { + initConfig(); m_texture[0] = m_texture[1] = 0; #ifdef KWIN_HAVE_XRENDER_COMPOSITING m_picture[0] = m_picture[1] = 0; diff --git a/effects/trackmouse/trackmouse.kcfg b/effects/trackmouse/trackmouse.kcfg index 296121c5d4..6be749399e 100644 --- a/effects/trackmouse/trackmouse.kcfg +++ b/effects/trackmouse/trackmouse.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + true diff --git a/effects/trackmouse/trackmouse_config.cpp b/effects/trackmouse/trackmouse_config.cpp index bacfc8fb94..51da99f47f 100644 --- a/effects/trackmouse/trackmouse_config.cpp +++ b/effects/trackmouse/trackmouse_config.cpp @@ -20,6 +20,7 @@ along with this program. If not, see . *********************************************************************/ #include +#include #include #include @@ -51,7 +52,7 @@ TrackMouseEffectConfigForm::TrackMouseEffectConfigForm(QWidget* parent) : QWidge TrackMouseEffectConfig::TrackMouseEffectConfig(QWidget* parent, const QVariantList& args) : KCModule(KAboutData::pluginData(QStringLiteral("trackmouse")), parent, args) { - + TrackMouseConfig::instance(KWIN_CONFIG); m_ui = new TrackMouseEffectConfigForm(this); QVBoxLayout* layout = new QVBoxLayout(this); layout->addWidget(m_ui); diff --git a/effects/windowgeometry/windowgeometry.cpp b/effects/windowgeometry/windowgeometry.cpp index 1290790351..d9c623fe81 100644 --- a/effects/windowgeometry/windowgeometry.cpp +++ b/effects/windowgeometry/windowgeometry.cpp @@ -34,6 +34,7 @@ using namespace KWin; WindowGeometry::WindowGeometry() { + initConfig(); iAmActivated = true; iAmActive = false; myResizeWindow = 0L; diff --git a/effects/windowgeometry/windowgeometry.kcfg b/effects/windowgeometry/windowgeometry.kcfg index e174aa63c5..4b79adb2e8 100644 --- a/effects/windowgeometry/windowgeometry.kcfg +++ b/effects/windowgeometry/windowgeometry.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + true diff --git a/effects/windowgeometry/windowgeometry_config.cpp b/effects/windowgeometry/windowgeometry_config.cpp index 97cdd5f4cf..3544e4c7f7 100644 --- a/effects/windowgeometry/windowgeometry_config.cpp +++ b/effects/windowgeometry/windowgeometry_config.cpp @@ -21,6 +21,7 @@ along with this program. If not, see . #include "windowgeometry_config.h" // KConfigSkeleton #include "windowgeometryconfig.h" +#include #include #include @@ -46,6 +47,7 @@ WindowGeometryConfigForm::WindowGeometryConfigForm(QWidget* parent) : QWidget(pa WindowGeometryConfig::WindowGeometryConfig(QWidget* parent, const QVariantList& args) : KCModule(KAboutData::pluginData(QStringLiteral("windowgeometry")), parent, args) { + WindowGeometryConfiguration::instance(KWIN_CONFIG); QVBoxLayout* layout = new QVBoxLayout(this); layout->addWidget(myUi = new WindowGeometryConfigForm(this)); diff --git a/effects/wobblywindows/wobblywindows.cpp b/effects/wobblywindows/wobblywindows.cpp index 2b32105b80..ca0aba58a6 100644 --- a/effects/wobblywindows/wobblywindows.cpp +++ b/effects/wobblywindows/wobblywindows.cpp @@ -146,6 +146,7 @@ static const ParameterSet pset[5] = { set_0, set_1, set_2, set_3, set_4 }; WobblyWindowsEffect::WobblyWindowsEffect() { + initConfig(); reconfigure(ReconfigureAll); connect(effects, SIGNAL(windowAdded(KWin::EffectWindow*)), this, SLOT(slotWindowAdded(KWin::EffectWindow*))); connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*))); diff --git a/effects/wobblywindows/wobblywindows.kcfg b/effects/wobblywindows/wobblywindows.kcfg index c843af9b3a..1212fb6579 100644 --- a/effects/wobblywindows/wobblywindows.kcfg +++ b/effects/wobblywindows/wobblywindows.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 0 diff --git a/effects/wobblywindows/wobblywindows_config.cpp b/effects/wobblywindows/wobblywindows_config.cpp index ebd3e31475..d9eaf5bdfc 100644 --- a/effects/wobblywindows/wobblywindows_config.cpp +++ b/effects/wobblywindows/wobblywindows_config.cpp @@ -22,6 +22,7 @@ along with this program. If not, see . #include "wobblywindows_config.h" // KConfigSkeleton #include "wobblywindowsconfig.h" +#include #include #include @@ -82,6 +83,7 @@ ParameterSet pset[5] = { set_0, set_1, set_2, set_3, set_4 }; WobblyWindowsEffectConfig::WobblyWindowsEffectConfig(QWidget* parent, const QVariantList& args) : KCModule(KAboutData::pluginData(QStringLiteral("wobblywindows")), parent, args) { + WobblyWindowsConfig::instance(KWIN_CONFIG); m_ui.setupUi(this); addConfig(WobblyWindowsConfig::self(), this); diff --git a/effects/zoom/zoom.cpp b/effects/zoom/zoom.cpp index 60bc03404b..9ea94cac96 100644 --- a/effects/zoom/zoom.cpp +++ b/effects/zoom/zoom.cpp @@ -60,6 +60,7 @@ ZoomEffect::ZoomEffect() , yMove(0) , moveFactor(20.0) { + initConfig(); QAction* a = 0; a = KStandardAction::zoomIn(this, SLOT(zoomIn()), this); KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_Equal); diff --git a/effects/zoom/zoom.kcfg b/effects/zoom/zoom.kcfg index b1df40fdba..c706906a7a 100644 --- a/effects/zoom/zoom.kcfg +++ b/effects/zoom/zoom.kcfg @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - + 1.2 diff --git a/effects/zoom/zoom_config.cpp b/effects/zoom/zoom_config.cpp index f31ba9e5f6..f7e0d1b1b5 100644 --- a/effects/zoom/zoom_config.cpp +++ b/effects/zoom/zoom_config.cpp @@ -22,6 +22,7 @@ along with this program. If not, see . #include "zoom_config.h" // KConfigSkeleton #include "zoomconfig.h" +#include #include #include @@ -49,6 +50,7 @@ ZoomEffectConfigForm::ZoomEffectConfigForm(QWidget* parent) : QWidget(parent) ZoomEffectConfig::ZoomEffectConfig(QWidget* parent, const QVariantList& args) : KCModule(KAboutData::pluginData(QStringLiteral("zoom")), parent, args) { + ZoomConfig::instance(KWIN_CONFIG); m_ui = new ZoomEffectConfigForm(this); QVBoxLayout* layout = new QVBoxLayout(this); diff --git a/libkwineffects/CMakeLists.txt b/libkwineffects/CMakeLists.txt index 2c3162a030..97717197de 100644 --- a/libkwineffects/CMakeLists.txt +++ b/libkwineffects/CMakeLists.txt @@ -89,7 +89,7 @@ macro( KWIN4_ADD_GLUTILS_BACKEND name glinclude ) include_directories(${glinclude}) add_library(${name} SHARED ${kwin_GLUTILSLIB_SRCS}) generate_export_header(${name} BASE_NAME kwinglutils EXPORT_FILE_NAME kwinglutils_export.h) - target_link_libraries(${name} PUBLIC XCB::XCB KF5::CoreAddons KF5::WindowSystem) + target_link_libraries(${name} PUBLIC XCB::XCB KF5::CoreAddons KF5::ConfigCore KF5::WindowSystem) set_target_properties(${name} PROPERTIES VERSION ${KWINEFFECTS_VERSION_STRING} SOVERSION ${KWINEFFECTS_SOVERSION} diff --git a/libkwineffects/kwineffects.h b/libkwineffects/kwineffects.h index d27fccca54..a417f71d74 100644 --- a/libkwineffects/kwineffects.h +++ b/libkwineffects/kwineffects.h @@ -43,6 +43,7 @@ along with this program. If not, see . #include #include +#include #include #include @@ -665,6 +666,14 @@ public Q_SLOTS: protected: xcb_connection_t *xcbConnection() const; xcb_window_t x11RootWindow() const; + + /** + * An implementing class can call this with it's kconfig compiled singleton class. + * This method will perform the instance on the class. + * @since 5.9 + **/ + template + void initConfig(); }; @@ -1291,6 +1300,12 @@ public: **/ virtual void hideOnScreenMessage(OnScreenMessageHideFlags flags = OnScreenMessageHideFlags()) = 0; + /* + * @returns The configuration used by the EffectsHandler. + * @since 5.10 + **/ + virtual KSharedConfigPtr config() const = 0; + Q_SIGNALS: /** * Signal emitted when the current desktop changed. @@ -3440,6 +3455,12 @@ int Effect::animationTime(int defaultDuration) return animationTime(T::duration() != 0 ? T::duration() : defaultDuration); } +template +void Effect::initConfig() +{ + T::instance(effects->config()); +} + } // namespace Q_DECLARE_METATYPE(KWin::EffectWindow*) Q_DECLARE_METATYPE(QList)