From 98eecafe29c4191d217ae06c9214567bee07132d Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Mon, 23 Oct 2023 15:57:00 +0300 Subject: [PATCH] libkwineffects: Make parent optional in OffscreenQuickView The parent argument is redundant if the view is managed with a smart pointer. --- src/libkwineffects/kwinoffscreenquickview.h | 8 ++++---- src/plugins/kdecorations/aurorae/src/aurorae.cpp | 2 +- src/plugins/showfps/showfpseffect.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libkwineffects/kwinoffscreenquickview.h b/src/libkwineffects/kwinoffscreenquickview.h index 7733ef6e26..cc8e8f25c2 100644 --- a/src/libkwineffects/kwinoffscreenquickview.h +++ b/src/libkwineffects/kwinoffscreenquickview.h @@ -60,12 +60,12 @@ public: * Construct a new KWinQuickView * Export mode will be determined by the current effectsHandler */ - OffscreenQuickView(QObject *parent); + explicit OffscreenQuickView(QObject *parent = nullptr); /** * Construct a new KWinQuickView explicitly stating an export mode */ - OffscreenQuickView(ExportMode exportMode, QObject *parent); + explicit OffscreenQuickView(ExportMode exportMode, QObject *parent = nullptr); /** * Note that this may change the current GL Context @@ -164,8 +164,8 @@ private: class KWINEFFECTS_EXPORT OffscreenQuickScene : public OffscreenQuickView { public: - OffscreenQuickScene(QObject *parent); - OffscreenQuickScene(ExportMode exportMode, QObject *parent); + explicit OffscreenQuickScene(QObject *parent = nullptr); + explicit OffscreenQuickScene(ExportMode exportMode, QObject *parent = nullptr); ~OffscreenQuickScene(); /** top level item in the given source*/ diff --git a/src/plugins/kdecorations/aurorae/src/aurorae.cpp b/src/plugins/kdecorations/aurorae/src/aurorae.cpp index 433e5ff681..48b445c765 100644 --- a/src/plugins/kdecorations/aurorae/src/aurorae.cpp +++ b/src/plugins/kdecorations/aurorae/src/aurorae.cpp @@ -288,7 +288,7 @@ bool Decoration::init() m_item->setParentItem(visualParent.value()); visualParent.value()->setProperty("drawBackground", false); } else { - m_view = std::make_unique(KWin::OffscreenQuickView::ExportMode::Image, this); + m_view = std::make_unique(KWin::OffscreenQuickView::ExportMode::Image); m_item->setParentItem(m_view->contentItem()); auto updateSize = [this]() { m_item->setSize(m_view->contentItem()->size()); diff --git a/src/plugins/showfps/showfpseffect.cpp b/src/plugins/showfps/showfpseffect.cpp index 97b0e5e85f..6d1b38a228 100644 --- a/src/plugins/showfps/showfpseffect.cpp +++ b/src/plugins/showfps/showfpseffect.cpp @@ -69,7 +69,7 @@ void ShowFpsEffect::prePaintScreen(ScreenPrePaintData &data, std::chrono::millis } if (!m_scene) { - m_scene = std::make_unique(nullptr); + m_scene = std::make_unique(); const auto url = QUrl::fromLocalFile(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("kwin/effects/showfps/qml/main.qml"))); m_scene->setSource(url, {{QStringLiteral("effect"), QVariant::fromValue(this)}}); }