diff --git a/clients/aurorae/src/aurorae.cpp b/clients/aurorae/src/aurorae.cpp index ed8c436475..28fe937c66 100644 --- a/clients/aurorae/src/aurorae.cpp +++ b/clients/aurorae/src/aurorae.cpp @@ -38,9 +38,8 @@ along with this program. If not, see . namespace Aurorae { -AuroraeFactory::AuroraeFactory() - : QObject() - , KDecorationFactory() +AuroraeFactory::AuroraeFactory(QObject *parent) + : KDecorationFactory(parent) , m_theme(new AuroraeTheme(this)) , m_engine(new QDeclarativeEngine(this)) , m_component(new QDeclarativeComponent(m_engine, this)) diff --git a/clients/aurorae/src/aurorae.h b/clients/aurorae/src/aurorae.h index eaf9725a1a..6ba1c2d50a 100644 --- a/clients/aurorae/src/aurorae.h +++ b/clients/aurorae/src/aurorae.h @@ -37,7 +37,7 @@ namespace Aurorae class AuroraeTheme; class AuroraeClient; -class AuroraeFactory : public QObject, public KDecorationFactory +class AuroraeFactory : public KDecorationFactory { Q_OBJECT public: @@ -62,7 +62,7 @@ private: AuroraeEngine, QMLEngine }; - AuroraeFactory(); + explicit AuroraeFactory(QObject *parent = nullptr); void init(); void initAurorae(KConfig &conf, KConfigGroup &group); void initQML(const KConfigGroup& group); diff --git a/clients/oxygen/oxygenfactory.cpp b/clients/oxygen/oxygenfactory.cpp index a9d53bfe3b..718ffb44e1 100644 --- a/clients/oxygen/oxygenfactory.cpp +++ b/clients/oxygen/oxygenfactory.cpp @@ -40,7 +40,8 @@ namespace Oxygen { //___________________________________________________ - Factory::Factory(): + Factory::Factory(QObject *parent): + KDecorationFactory(parent), _initialized( false ), _helper(), _shadowCache( _helper ) diff --git a/clients/oxygen/oxygenfactory.h b/clients/oxygen/oxygenfactory.h index a3e517c62f..25dbae2af7 100644 --- a/clients/oxygen/oxygenfactory.h +++ b/clients/oxygen/oxygenfactory.h @@ -54,7 +54,7 @@ namespace Oxygen }; //! window decoration factory - class Factory: public QObject, public KDecorationFactory + class Factory: public KDecorationFactory { Q_OBJECT @@ -62,7 +62,7 @@ namespace Oxygen public: //! constructor - Factory(); + explicit Factory(QObject *parent = nullptr); //! destructor virtual ~Factory(); diff --git a/libkdecorations/kdecorationfactory.cpp b/libkdecorations/kdecorationfactory.cpp index 7fb2d087ce..8aa0ff62a5 100644 --- a/libkdecorations/kdecorationfactory.cpp +++ b/libkdecorations/kdecorationfactory.cpp @@ -36,7 +36,9 @@ public: Qt::Corner closeButtonCorner; }; -KDecorationFactory::KDecorationFactory() : d(new KDecorationFactoryPrivate) +KDecorationFactory::KDecorationFactory(QObject *parent) + : QObject(parent) + , d(new KDecorationFactoryPrivate) { } diff --git a/libkdecorations/kdecorationfactory.h b/libkdecorations/kdecorationfactory.h index c621cb8f4f..7b40f93fe2 100644 --- a/libkdecorations/kdecorationfactory.h +++ b/libkdecorations/kdecorationfactory.h @@ -35,14 +35,15 @@ class KDecorationBridge; class KDecorationFactoryPrivate; class KWIN_EXPORT KDecorationFactory - : public KDecorationDefines + : public QObject, public KDecorationDefines { + Q_OBJECT public: /** * Constructor. Called after loading the decoration plugin. All global * initialization of the plugin should be done in the factory constructor. */ - KDecorationFactory(); + explicit KDecorationFactory(QObject *parent = nullptr); /** * Destructor. Called before unloading the decoration plugin. All global * cleanup of the plugin should be done in the factory destructor.