From c5697d64159b90add0e19ff01481a6c194c03710 Mon Sep 17 00:00:00 2001 From: Vlad Zagorodniy Date: Fri, 25 May 2018 18:46:38 +0300 Subject: [PATCH] [effects/slide] Const-ify variables Summary: It improves a little bit readability and comprehensibility of the code. Reviewers: #kwin, mart Reviewed By: #kwin, mart Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D13116 --- effects/slide/slide.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/effects/slide/slide.cpp b/effects/slide/slide.cpp index e62aa2b32a..26c405f2f2 100644 --- a/effects/slide/slide.cpp +++ b/effects/slide/slide.cpp @@ -110,7 +110,7 @@ inline void wrapDiff(QPoint& diff, int w, int h) } } -inline QRegion buildClipRegion(QPoint pos, int w, int h) +inline QRegion buildClipRegion(const QPoint& pos, int w, int h) { const QSize screenSize = effects->virtualScreenSize(); QRegion r = QRect(pos, screenSize); @@ -152,9 +152,9 @@ void SlideEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data) QVector visibleDesktops; visibleDesktops.reserve(4); // 4 - maximum number of visible desktops - QRegion clipRegion = buildClipRegion(currentPos, w, h); + const QRegion clipRegion = buildClipRegion(currentPos, w, h); for (int i = 1; i <= effects->numberOfDesktops(); i++) { - QRect desktopGeo = desktopGeometry(i); + const QRect desktopGeo = desktopGeometry(i); if (! clipRegion.contains(desktopGeo)) { continue; } @@ -296,7 +296,7 @@ void SlideEffect::postPaintScreen() QPoint SlideEffect::desktopCoords(int id) const { QPoint c = effects->desktopCoords(id); - QPoint gridPos = effects->desktopGridCoords(id); + const QPoint gridPos = effects->desktopGridCoords(id); c.setX(c.x() + m_hGap * gridPos.x()); c.setY(c.y() + m_vGap * gridPos.y()); return c; @@ -356,7 +356,7 @@ bool SlideEffect::shouldForceBlur(const EffectWindow* w) const // if (surf) { // return !surf->blur().isNull(); // } - KWayland::Server::SurfaceInterface* surf = w->surface(); + const KWayland::Server::SurfaceInterface* surf = w->surface(); if (surf && surf->blur()) { return true; } @@ -385,7 +385,7 @@ bool SlideEffect::shouldForceBackgroundContrast(const EffectWindow* w) const // if (surf) { // return !surf->contrast().isNull(); // } - KWayland::Server::SurfaceInterface* surf = w->surface(); + const KWayland::Server::SurfaceInterface* surf = w->surface(); if (surf && surf->contrast()) { return true; }