From ede01e17026d7052c3dad553fe5efdf7f5a08629 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Thu, 29 Sep 2011 15:17:59 +0200 Subject: [PATCH] the Qt idiom is that out parameters are pointers --- client.h | 2 +- geometry.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/client.h b/client.h index 66b9c466b0..86d577803a 100644 --- a/client.h +++ b/client.h @@ -569,7 +569,7 @@ private: Time readUserCreationTime() const; void startupIdChanged(); - void checkOffscreenPosition (QRect& geom, const QRect& screenArea); + void checkOffscreenPosition (QRect* geom, const QRect& screenArea); Window client; Window wrapper; diff --git a/geometry.cpp b/geometry.cpp index 5c7cbe5d5b..9f4049d157 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -1036,7 +1036,7 @@ void Client::checkWorkspacePosition(const QRect &geo) changeMaximize(false, false, true); // adjust size const QRect &screenArea = workspace()->clientArea(ScreenArea, this); QRect geom = geometry(); - checkOffscreenPosition(geom, screenArea); + checkOffscreenPosition(&geom, screenArea); setGeometry(geom); return; } @@ -1161,7 +1161,7 @@ void Client::checkWorkspacePosition(const QRect &geo) newGeom.x() + newGeom.width() - 1)); } - checkOffscreenPosition(newGeom, screenArea); + checkOffscreenPosition(&newGeom, screenArea); // Obey size hints. TODO: We really should make sure it stays in the right place newGeom.setSize(adjustedSize(newGeom.size())); @@ -1170,15 +1170,15 @@ void Client::checkWorkspacePosition(const QRect &geo) } } -void Client::checkOffscreenPosition(QRect& geom, const QRect& screenArea) +void Client::checkOffscreenPosition(QRect* geom, const QRect& screenArea) { - if (geom.x() > screenArea.right()) { + if (geom->x() > screenArea.right()) { int screenWidth = screenArea.width(); - geom.moveLeft(screenWidth - (screenWidth / 4)); + geom->moveLeft(screenWidth - (screenWidth / 4)); } - if (geom.y() > screenArea.bottom()) { + if (geom->y() > screenArea.bottom()) { int screenHeight = screenArea.height(); - geom.moveBottom(screenHeight - (screenHeight / 4)); + geom->moveBottom(screenHeight - (screenHeight / 4)); } }