diff --git a/src/libkwineffects/effect.h b/src/libkwineffects/effect.h index 7b70c8efa8..e142f343fd 100644 --- a/src/libkwineffects/effect.h +++ b/src/libkwineffects/effect.h @@ -924,15 +924,6 @@ public: public Q_SLOTS: virtual bool borderActivated(ElectricBorder border); - -protected: - /** - * 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(); }; /** diff --git a/src/libkwineffects/effects.h b/src/libkwineffects/effects.h index 66f055e9fe..ba7c48f273 100644 --- a/src/libkwineffects/effects.h +++ b/src/libkwineffects/effects.h @@ -2746,12 +2746,6 @@ int Effect::animationTime(int defaultDuration) return animationTime(T::duration() != 0 ? T::duration() : defaultDuration); } -template -void Effect::initConfig() -{ - T::instance(effects->config()); -} - /*************************************************************** EffectWindow ***************************************************************/ diff --git a/src/plugins/blur/blur.cpp b/src/plugins/blur/blur.cpp index 6d4b75ebd2..b554cbf488 100644 --- a/src/plugins/blur/blur.cpp +++ b/src/plugins/blur/blur.cpp @@ -50,7 +50,7 @@ QTimer *BlurEffect::s_blurManagerRemoveTimer = nullptr; BlurEffect::BlurEffect() { - initConfig(); + BlurConfig::instance(effects->config()); ensureResources(); m_downsamplePass.shader = ShaderManager::instance()->generateShaderFromFile(ShaderTrait::MapTexture, diff --git a/src/plugins/diminactive/diminactive.cpp b/src/plugins/diminactive/diminactive.cpp index fd6990f0d9..e187681458 100644 --- a/src/plugins/diminactive/diminactive.cpp +++ b/src/plugins/diminactive/diminactive.cpp @@ -36,7 +36,7 @@ static inline bool belongToSameGroup(const EffectWindow *w1, const EffectWindow DimInactiveEffect::DimInactiveEffect() { - initConfig(); + DimInactiveConfig::instance(effects->config()); reconfigure(ReconfigureAll); connect(effects, &EffectsHandler::windowActivated, diff --git a/src/plugins/fallapart/fallapart.cpp b/src/plugins/fallapart/fallapart.cpp index 7fae1cf09d..59a0911cf6 100644 --- a/src/plugins/fallapart/fallapart.cpp +++ b/src/plugins/fallapart/fallapart.cpp @@ -31,7 +31,7 @@ bool FallApartEffect::supported() FallApartEffect::FallApartEffect() { - initConfig(); + FallApartConfig::instance(effects->config()); reconfigure(ReconfigureAll); connect(effects, &EffectsHandler::windowClosed, this, &FallApartEffect::slotWindowClosed); connect(effects, &EffectsHandler::windowDataChanged, this, &FallApartEffect::slotWindowDataChanged); diff --git a/src/plugins/glide/glide.cpp b/src/plugins/glide/glide.cpp index 1d2f5d8ee3..a9356aaa4e 100644 --- a/src/plugins/glide/glide.cpp +++ b/src/plugins/glide/glide.cpp @@ -68,7 +68,7 @@ static QMatrix4x4 createPerspectiveMatrix(const QRectF &rect, const qreal scale, GlideEffect::GlideEffect() { - initConfig(); + GlideConfig::instance(effects->config()); reconfigure(ReconfigureAll); connect(effects, &EffectsHandler::windowAdded, this, &GlideEffect::windowAdded); diff --git a/src/plugins/kscreen/kscreen.cpp b/src/plugins/kscreen/kscreen.cpp index 968c3b72a5..35240e62b6 100644 --- a/src/plugins/kscreen/kscreen.cpp +++ b/src/plugins/kscreen/kscreen.cpp @@ -47,7 +47,7 @@ KscreenEffect::KscreenEffect() : Effect() , m_atom(effects->waylandDisplay() ? XCB_ATOM_NONE : effects->announceSupportProperty("_KDE_KWIN_KSCREEN_SUPPORT", this)) { - initConfig(); + KscreenConfig::instance(effects->config()); if (!effects->waylandDisplay()) { connect(effects, &EffectsHandler::propertyNotify, this, &KscreenEffect::propertyNotify); connect(effects, &EffectsHandler::xcbConnectionChanged, this, [this]() { diff --git a/src/plugins/magiclamp/magiclamp.cpp b/src/plugins/magiclamp/magiclamp.cpp index f7d2be8777..d41105d708 100644 --- a/src/plugins/magiclamp/magiclamp.cpp +++ b/src/plugins/magiclamp/magiclamp.cpp @@ -18,7 +18,7 @@ namespace KWin MagicLampEffect::MagicLampEffect() { - initConfig(); + MagicLampConfig::instance(effects->config()); reconfigure(ReconfigureAll); connect(effects, &EffectsHandler::windowAdded, this, &MagicLampEffect::slotWindowAdded); connect(effects, &EffectsHandler::windowDeleted, this, &MagicLampEffect::slotWindowDeleted); diff --git a/src/plugins/magnifier/magnifier.cpp b/src/plugins/magnifier/magnifier.cpp index 97e534a8c4..a422c9cdfc 100644 --- a/src/plugins/magnifier/magnifier.cpp +++ b/src/plugins/magnifier/magnifier.cpp @@ -33,7 +33,7 @@ MagnifierEffect::MagnifierEffect() , m_texture(nullptr) , m_fbo(nullptr) { - initConfig(); + MagnifierConfig::instance(effects->config()); QAction *a; a = KStandardAction::zoomIn(this, &MagnifierEffect::zoomIn, this); KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::Key_Equal)); diff --git a/src/plugins/mouseclick/mouseclick.cpp b/src/plugins/mouseclick/mouseclick.cpp index 8972fa433d..2ace4b1ec1 100644 --- a/src/plugins/mouseclick/mouseclick.cpp +++ b/src/plugins/mouseclick/mouseclick.cpp @@ -29,7 +29,7 @@ namespace KWin MouseClickEffect::MouseClickEffect() { - initConfig(); + MouseClickConfig::instance(effects->config()); m_enabled = false; QAction *a = new QAction(this); diff --git a/src/plugins/mousemark/mousemark.cpp b/src/plugins/mousemark/mousemark.cpp index 2d687dae73..12776603d0 100644 --- a/src/plugins/mousemark/mousemark.cpp +++ b/src/plugins/mousemark/mousemark.cpp @@ -36,7 +36,7 @@ static consteval QPoint nullPoint() MouseMarkEffect::MouseMarkEffect() { - initConfig(); + MouseMarkConfig::instance(effects->config()); QAction *a = new QAction(this); a->setObjectName(QStringLiteral("ClearMouseMarks")); a->setText(i18n("Clear All Mouse Marks")); diff --git a/src/plugins/overview/overvieweffect.cpp b/src/plugins/overview/overvieweffect.cpp index 65e99ba1b6..790cd6cc62 100644 --- a/src/plugins/overview/overvieweffect.cpp +++ b/src/plugins/overview/overvieweffect.cpp @@ -154,7 +154,7 @@ OverviewEffect::OverviewEffect() connect(effects, &EffectsHandler::screenAboutToLock, this, &OverviewEffect::realDeactivate); - initConfig(); + OverviewConfig::instance(effects->config()); reconfigure(ReconfigureAll); setSource(QUrl(QStringLiteral("qrc:/overview/qml/main.qml"))); diff --git a/src/plugins/sheet/sheet.cpp b/src/plugins/sheet/sheet.cpp index 8a77997f09..3eb21582e7 100644 --- a/src/plugins/sheet/sheet.cpp +++ b/src/plugins/sheet/sheet.cpp @@ -54,7 +54,7 @@ static QMatrix4x4 createPerspectiveMatrix(const QRectF &rect, const qreal scale) SheetEffect::SheetEffect() { - initConfig(); + SheetConfig::instance(effects->config()); reconfigure(ReconfigureAll); connect(effects, &EffectsHandler::windowAdded, this, &SheetEffect::slotWindowAdded); diff --git a/src/plugins/slide/slide.cpp b/src/plugins/slide/slide.cpp index 9ea1482eeb..e05ff44fdb 100644 --- a/src/plugins/slide/slide.cpp +++ b/src/plugins/slide/slide.cpp @@ -23,7 +23,7 @@ namespace KWin SlideEffect::SlideEffect() { - initConfig(); + SlideConfig::instance(effects->config()); reconfigure(ReconfigureAll); connect(effects, &EffectsHandler::desktopChanged, diff --git a/src/plugins/slidingpopups/slidingpopups.cpp b/src/plugins/slidingpopups/slidingpopups.cpp index 215ab07dbc..b4018c5069 100644 --- a/src/plugins/slidingpopups/slidingpopups.cpp +++ b/src/plugins/slidingpopups/slidingpopups.cpp @@ -32,7 +32,7 @@ QTimer *SlidingPopupsEffect::s_slideManagerRemoveTimer = nullptr; SlidingPopupsEffect::SlidingPopupsEffect() { - initConfig(); + SlidingPopupsConfig::instance(effects->config()); Display *display = effects->waylandDisplay(); if (display) { diff --git a/src/plugins/thumbnailaside/thumbnailaside.cpp b/src/plugins/thumbnailaside/thumbnailaside.cpp index e8792f5162..ae2867dba9 100644 --- a/src/plugins/thumbnailaside/thumbnailaside.cpp +++ b/src/plugins/thumbnailaside/thumbnailaside.cpp @@ -25,7 +25,7 @@ namespace KWin ThumbnailAsideEffect::ThumbnailAsideEffect() { - initConfig(); + ThumbnailAsideConfig::instance(effects->config()); QAction *a = new QAction(this); a->setObjectName(QStringLiteral("ToggleCurrentThumbnail")); a->setText(i18n("Toggle Thumbnail for Current Window")); diff --git a/src/plugins/trackmouse/trackmouse.cpp b/src/plugins/trackmouse/trackmouse.cpp index 4ead665efa..ce3f52dee2 100644 --- a/src/plugins/trackmouse/trackmouse.cpp +++ b/src/plugins/trackmouse/trackmouse.cpp @@ -34,7 +34,7 @@ namespace KWin TrackMouseEffect::TrackMouseEffect() : m_angle(0) { - initConfig(); + TrackMouseConfig::instance(effects->config()); if (effects->isOpenGLCompositing() || effects->compositingType() == QPainterCompositing) { m_angleBase = 90.0; } diff --git a/src/plugins/windowview/windowvieweffect.cpp b/src/plugins/windowview/windowvieweffect.cpp index e233865de0..cfa4b270f3 100644 --- a/src/plugins/windowview/windowvieweffect.cpp +++ b/src/plugins/windowview/windowvieweffect.cpp @@ -30,7 +30,7 @@ WindowViewEffect::WindowViewEffect() , m_exposeClassCurrentDesktopAction(new QAction(this)) { qmlRegisterUncreatableType("org.kde.KWin.Effect.WindowView", 1, 0, "WindowView", QStringLiteral("WindowView cannot be created in QML")); - initConfig(); + WindowViewConfig::instance(effects->config()); new WindowView1Adaptor(this); QDBusConnection::sessionBus().registerObject(s_dbusObjectPath, this); diff --git a/src/plugins/wobblywindows/wobblywindows.cpp b/src/plugins/wobblywindows/wobblywindows.cpp index 98611886d8..1cdd49e1d1 100644 --- a/src/plugins/wobblywindows/wobblywindows.cpp +++ b/src/plugins/wobblywindows/wobblywindows.cpp @@ -121,7 +121,7 @@ static const ParameterSet pset[5] = {set_0, set_1, set_2, set_3, set_4}; WobblyWindowsEffect::WobblyWindowsEffect() { - initConfig(); + WobblyWindowsConfig::instance(effects->config()); reconfigure(ReconfigureAll); connect(effects, &EffectsHandler::windowAdded, this, &WobblyWindowsEffect::slotWindowAdded); diff --git a/src/plugins/zoom/zoom.cpp b/src/plugins/zoom/zoom.cpp index f8021bb5a4..8db703e37b 100644 --- a/src/plugins/zoom/zoom.cpp +++ b/src/plugins/zoom/zoom.cpp @@ -46,7 +46,7 @@ ZoomEffect::ZoomEffect() , moveFactor(20.0) , lastPresentTime(std::chrono::milliseconds::zero()) { - initConfig(); + ZoomConfig::instance(effects->config()); QAction *a = nullptr; a = KStandardAction::zoomIn(this, SLOT(zoomIn()), this); KGlobalAccel::self()->setDefaultShortcut(a, QList() << (Qt::META | Qt::Key_Plus));