libkwineffects: Drop QObject parent argument in OffscreenQuickView constructor

All usages of OffscreenQuickView have been ported to smart pointers. So
let's drop the QObject parent argument to simplify the API.
This commit is contained in:
Vlad Zahorodnii 2023-10-23 20:16:05 +03:00
parent 8cc1c7eca7
commit fb638f26c5
5 changed files with 11 additions and 36 deletions

View file

@ -2154,10 +2154,8 @@ EffectWindowList EffectWindowGroupImpl::members() const
// EffectFrameImpl
//****************************************
EffectFrameQuickScene::EffectFrameQuickScene(EffectFrameStyle style, bool staticSize, QPoint position,
Qt::Alignment alignment, QObject *parent)
: OffscreenQuickScene(parent)
, m_style(style)
EffectFrameQuickScene::EffectFrameQuickScene(EffectFrameStyle style, bool staticSize, QPoint position, Qt::Alignment alignment)
: m_style(style)
, m_static(staticSize)
, m_point(position)
, m_alignment(alignment)
@ -2366,9 +2364,7 @@ void EffectFrameQuickScene::reposition()
}
EffectFrameImpl::EffectFrameImpl(EffectFrameStyle style, bool staticSize, QPoint position, Qt::Alignment alignment)
: QObject(nullptr)
, EffectFrame()
, m_view(new EffectFrameQuickScene(style, staticSize, position, alignment, nullptr))
: m_view(new EffectFrameQuickScene(style, staticSize, position, alignment))
{
connect(m_view, &OffscreenQuickScene::repaintNeeded, this, [this] {
effects->addRepaint(geometry());

View file

@ -506,8 +506,7 @@ class EffectFrameQuickScene : public OffscreenQuickScene
Q_PROPERTY(qreal crossFadeProgress READ crossFadeProgress NOTIFY crossFadeProgressChanged)
public:
EffectFrameQuickScene(EffectFrameStyle style, bool staticSize, QPoint position,
Qt::Alignment alignment, QObject *parent = nullptr);
EffectFrameQuickScene(EffectFrameStyle style, bool staticSize, QPoint position, Qt::Alignment alignment);
~EffectFrameQuickScene() override;
EffectFrameStyle style() const;

View file

@ -73,14 +73,8 @@ public:
std::unique_ptr<QQuickItem> quickItem;
};
OffscreenQuickView::OffscreenQuickView(QObject *parent)
: OffscreenQuickView(ExportMode::Texture, parent)
{
}
OffscreenQuickView::OffscreenQuickView(ExportMode exportMode, QObject *parent)
: QObject(parent)
, d(new OffscreenQuickView::Private)
OffscreenQuickView::OffscreenQuickView(ExportMode exportMode)
: d(new OffscreenQuickView::Private)
{
d->m_renderControl = std::make_unique<QQuickRenderControl>();
@ -520,14 +514,8 @@ void OffscreenQuickView::Private::updateTouchState(Qt::TouchPointState state, qi
}
}
OffscreenQuickScene::OffscreenQuickScene(QObject *parent)
: OffscreenQuickView(parent)
, d(new OffscreenQuickScene::Private)
{
}
OffscreenQuickScene::OffscreenQuickScene(OffscreenQuickView::ExportMode exportMode, QObject *parent)
: OffscreenQuickView(exportMode, parent)
OffscreenQuickScene::OffscreenQuickScene(OffscreenQuickView::ExportMode exportMode)
: OffscreenQuickView(exportMode)
, d(new OffscreenQuickScene::Private)
{
}

View file

@ -56,16 +56,10 @@ public:
Image
};
/**
* Construct a new KWinQuickView
* Export mode will be determined by the current effectsHandler
*/
explicit OffscreenQuickView(QObject *parent = nullptr);
/**
* Construct a new KWinQuickView explicitly stating an export mode
*/
explicit OffscreenQuickView(ExportMode exportMode = ExportMode::Texture, QObject *parent = nullptr);
explicit OffscreenQuickView(ExportMode exportMode = ExportMode::Texture);
/**
* Note that this may change the current GL Context
@ -164,8 +158,7 @@ private:
class KWINEFFECTS_EXPORT OffscreenQuickScene : public OffscreenQuickView
{
public:
explicit OffscreenQuickScene(QObject *parent = nullptr);
explicit OffscreenQuickScene(ExportMode exportMode, QObject *parent = nullptr);
explicit OffscreenQuickScene(ExportMode exportMode = ExportMode::Texture);
~OffscreenQuickScene();
/** top level item in the given source*/

View file

@ -83,8 +83,7 @@ bool QuickSceneEffectPrivate::isItemOnScreen(QQuickItem *item, EffectScreen *scr
}
QuickSceneView::QuickSceneView(QuickSceneEffect *effect, EffectScreen *screen)
: OffscreenQuickView(effect)
, m_effect(effect)
: m_effect(effect)
, m_screen(screen)
{
setGeometry(screen->geometry());