libkwineffects: Simplify EffectQuickView constructors

This simplifies EffectQuickView constructors and ensures that there
won't be a crash if compositing is off.
This commit is contained in:
Vlad Zahorodnii 2021-09-22 13:02:16 +03:00
parent 1b215e6c06
commit 21a17c87db

View file

@ -80,7 +80,7 @@ public:
};
EffectQuickView::EffectQuickView(QObject *parent)
: EffectQuickView(parent, effects->isOpenGLCompositing() ? ExportMode::Texture : ExportMode::Image)
: EffectQuickView(parent, effects ? ExportMode::Texture : ExportMode::Image)
{
}
@ -90,7 +90,7 @@ EffectQuickView::EffectQuickView(QObject *parent, ExportMode exportMode)
}
EffectQuickView::EffectQuickView(QObject *parent, QWindow *renderWindow)
: EffectQuickView(parent, renderWindow, effects->isOpenGLCompositing() ? ExportMode::Texture : ExportMode::Image)
: EffectQuickView(parent, renderWindow, effects ? ExportMode::Texture : ExportMode::Image)
{
}