diff --git a/libkdecorations/kdecoration.cpp b/libkdecorations/kdecoration.cpp index 4e9f4f5f7f..7e0ac61686 100644 --- a/libkdecorations/kdecoration.cpp +++ b/libkdecorations/kdecoration.cpp @@ -54,13 +54,15 @@ inheriting KCommonDecoration and adding the new API matching KDecoration2. class KDecorationPrivate { public: - KDecorationPrivate(KDecorationBridge *b) + KDecorationPrivate(KDecorationBridge *b, KDecorationFactory *f) : bridge(b) + , factory(f) , alphaEnabled(false) , w() { } KDecorationBridge *bridge; + KDecorationFactory *factory; bool alphaEnabled; QScopedPointer w; }; @@ -68,8 +70,7 @@ public: KDecorationOptions* KDecoration::options_; KDecoration::KDecoration(KDecorationBridge* bridge, KDecorationFactory* factory) - : factory_(factory), - d(new KDecorationPrivate(bridge)) + : d(new KDecorationPrivate(bridge, factory)) { factory->addDecoration(this); connect(this, static_cast(&KDecoration::keepAboveChanged), @@ -517,7 +518,7 @@ const QWidget* KDecoration::widget() const KDecorationFactory* KDecoration::factory() const { - return factory_; + return d->factory; } bool KDecoration::isOnAllDesktops() const diff --git a/libkdecorations/kdecoration.h b/libkdecorations/kdecoration.h index 695574a85f..5e1983c1ed 100644 --- a/libkdecorations/kdecoration.h +++ b/libkdecorations/kdecoration.h @@ -1156,7 +1156,6 @@ protected Q_SLOTS: QRegion region(KDecorationDefines::Region r); private: - KDecorationFactory* factory_; friend class KDecorationOptions; // for options_ static KDecorationOptions* options_; KDecorationPrivate* d;