From e1c6433c8e168a9ad586cfc93a81e8f929ee5d88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arto=20Hyt=C3=B6nen?= Date: Sun, 2 Sep 2007 20:01:17 +0000 Subject: [PATCH] pass-by-value -> reference-to-count fixes svn path=/trunk/KDE/kdebase/workspace/; revision=707741 --- bridge.cpp | 2 +- bridge.h | 2 +- client.h | 2 +- clients/b2/b2client.cpp | 2 +- clients/plastik/misc.cpp | 2 +- effects/boxswitch.cpp | 2 +- effects/magnifier.cpp | 2 +- kcmkwin/kwindecoration/buttons.cpp | 4 ++-- kcmkwin/kwindecoration/preview.cpp | 2 +- lib/kdecoration_p.h | 2 +- popupinfo.cpp | 2 +- popupinfo.h | 2 +- tools/decobenchmark/preview.cpp | 4 ++-- useractions.cpp | 2 +- workspace.cpp | 6 +++--- workspace.h | 6 +++--- 16 files changed, 22 insertions(+), 22 deletions(-) diff --git a/bridge.cpp b/bridge.cpp index bc9715119f..6ac1a16e2c 100644 --- a/bridge.cpp +++ b/bridge.cpp @@ -80,7 +80,7 @@ bool Bridge::isSetShade() const return c->shadeMode() != ShadeNone; } -void Bridge::showWindowMenu( QPoint p ) +void Bridge::showWindowMenu( const QPoint &p ) { c->workspace()->showWindowMenu( p, c ); } diff --git a/bridge.h b/bridge.h index d8cfbafcdd..b721f38db5 100644 --- a/bridge.h +++ b/bridge.h @@ -41,7 +41,7 @@ class Bridge : public KDecorationBridge virtual QIcon icon() const; virtual QString caption() const; virtual void processMousePressEvent( QMouseEvent* ); - virtual void showWindowMenu( QPoint ); + virtual void showWindowMenu( const QPoint & ); virtual void showWindowMenu( const QRect & ); virtual void performWindowOperation( WindowOperation ); virtual void setMask( const QRegion&, int ); diff --git a/client.h b/client.h index 460d198677..b98ba65958 100644 --- a/client.h +++ b/client.h @@ -209,7 +209,7 @@ class Client KShortcut shortcut() const; void setShortcut( const QString& cut ); - bool performMouseCommand( Options::MouseCommand, QPoint globalPos, bool handled = false ); + bool performMouseCommand( Options::MouseCommand, const QPoint &globalPos, bool handled = false ); QRect adjustedClientArea( const QRect& desktop, const QRect& area ) const; diff --git a/clients/b2/b2client.cpp b/clients/b2/b2client.cpp index 88998a32a4..cc3b0e7281 100644 --- a/clients/b2/b2client.cpp +++ b/clients/b2/b2client.cpp @@ -456,7 +456,7 @@ void B2Client::init() titlebar->installEventFilter(this); } -void B2Client::addButtons(const QString& s, const QString tips[], +void B2Client::addButtons(const QString& s, const QString &tips[], B2Titlebar* tb, QBoxLayout* titleLayout) { if (s.length() <= 0) diff --git a/clients/plastik/misc.cpp b/clients/plastik/misc.cpp index 8406c2207a..12568f8490 100644 --- a/clients/plastik/misc.cpp +++ b/clients/plastik/misc.cpp @@ -67,7 +67,7 @@ QColor alphaBlendColors(const QColor &bgColor, const QColor &fgColor, const int return result; } -QImage recolorImage(QImage *img, QColor color) { +QImage recolorImage(QImage *img, const QColor &color) { QImage destImg(img->width(),img->height(), QImage::Format_ARGB32); for (int x = 0; x < img->width(); x++) { for (int y = 0; y < img->height(); y++) { diff --git a/effects/boxswitch.cpp b/effects/boxswitch.cpp index c9ce83e5d4..3d6c89c73b 100644 --- a/effects/boxswitch.cpp +++ b/effects/boxswitch.cpp @@ -465,7 +465,7 @@ void BoxSwitchEffect::paintFrame() #endif } -void BoxSwitchEffect::paintHighlight( QRect area ) +void BoxSwitchEffect::paintHighlight( const QRect &area ) { QColor color = KColorScheme( KColorScheme::Selection ).background(); color.setAlphaF( 0.9 ); diff --git a/effects/magnifier.cpp b/effects/magnifier.cpp index cb34f238d9..9bbde292f8 100644 --- a/effects/magnifier.cpp +++ b/effects/magnifier.cpp @@ -110,7 +110,7 @@ void MagnifierEffect::postPaintScreen() effects->postPaintScreen(); } -QRect MagnifierEffect::magnifierArea( QPoint pos ) const +QRect MagnifierEffect::magnifierArea( const QPoint &pos ) const { return QRect( pos.x() - magnifier_size.width() / 2, pos.y() - magnifier_size.height() / 2, magnifier_size.width(), magnifier_size.height()); diff --git a/kcmkwin/kwindecoration/buttons.cpp b/kcmkwin/kwindecoration/buttons.cpp index 2ec7715bc1..31534cda3f 100644 --- a/kcmkwin/kwindecoration/buttons.cpp +++ b/kcmkwin/kwindecoration/buttons.cpp @@ -261,7 +261,7 @@ int ButtonDropSiteItem::height() return 20; } -void ButtonDropSiteItem::draw(QPainter *p, const QPalette& cg, QRect r) +void ButtonDropSiteItem::draw(QPainter *p, const QPalette& cg, const QRect &r) { // p->fillRect(r, cg.base() ); if (m_button.supported) @@ -529,7 +529,7 @@ void ButtonDropSite::recalcItemGeometry() } } -ButtonDropSiteItem *ButtonDropSite::buttonAt(QPoint p) { +ButtonDropSiteItem *ButtonDropSite::buttonAt(const QPoint &p) { // try to find the item in the left button list for (ButtonList::const_iterator it = buttonsLeft.begin(); it != buttonsLeft.end(); ++it) { if ( (*it)->rect.contains(p) ) { diff --git a/kcmkwin/kwindecoration/preview.cpp b/kcmkwin/kwindecoration/preview.cpp index a0898fd61b..e79ba32bda 100644 --- a/kcmkwin/kwindecoration/preview.cpp +++ b/kcmkwin/kwindecoration/preview.cpp @@ -342,7 +342,7 @@ void KDecorationPreviewBridge::showWindowMenu( const QRect &) { } -void KDecorationPreviewBridge::showWindowMenu( QPoint ) +void KDecorationPreviewBridge::showWindowMenu( const QPoint & ) { } diff --git a/lib/kdecoration_p.h b/lib/kdecoration_p.h index a9133eecbf..a532039d83 100644 --- a/lib/kdecoration_p.h +++ b/lib/kdecoration_p.h @@ -81,7 +81,7 @@ class KDecorationBridge : public KDecorationDefines virtual QString caption() const = 0; virtual void processMousePressEvent( QMouseEvent* ) = 0; virtual void showWindowMenu( const QRect &) = 0; - virtual void showWindowMenu( QPoint ) = 0; + virtual void showWindowMenu( const QPoint & ) = 0; virtual void performWindowOperation( WindowOperation ) = 0; virtual void setMask( const QRegion&, int ) = 0; virtual bool isPreview() const = 0; diff --git a/popupinfo.cpp b/popupinfo.cpp index 5d3b76a9f5..bb752270fd 100644 --- a/popupinfo.cpp +++ b/popupinfo.cpp @@ -131,7 +131,7 @@ void PopupInfo::reconfigure() m_delayTime = cg.readEntry("PopupHideDelay", 350 ); } -void PopupInfo::showInfo(QString infoString) +void PopupInfo::showInfo(const QString &infoString) { if (m_show) { diff --git a/popupinfo.h b/popupinfo.h index 90262c3b21..09f2b4a82e 100644 --- a/popupinfo.h +++ b/popupinfo.h @@ -28,7 +28,7 @@ class PopupInfo : public QWidget void reset(); void hide(); - void showInfo(QString infoString); + void showInfo(const QString &infoString); void reconfigure(); diff --git a/tools/decobenchmark/preview.cpp b/tools/decobenchmark/preview.cpp index da70fed19a..bd12846bd8 100644 --- a/tools/decobenchmark/preview.cpp +++ b/tools/decobenchmark/preview.cpp @@ -291,11 +291,11 @@ void KDecorationPreviewBridge::processMousePressEvent( QMouseEvent* ) { } -void KDecorationPreviewBridge::showWindowMenu( const QRect &) +void KDecorationPreviewBridge::showWindowMenu( const QRect & ) { } -void KDecorationPreviewBridge::showWindowMenu( QPoint ) +void KDecorationPreviewBridge::showWindowMenu( const QPoint & ) { } diff --git a/useractions.cpp b/useractions.cpp index 892848e566..af605ec7a5 100644 --- a/useractions.cpp +++ b/useractions.cpp @@ -534,7 +534,7 @@ void Workspace::performWindowOperation( Client* c, Options::WindowOperation op ) /*! Performs a mouse command on this client (see options.h) */ -bool Client::performMouseCommand( Options::MouseCommand command, QPoint globalPos, bool handled ) +bool Client::performMouseCommand( Options::MouseCommand command, const QPoint &globalPos, bool handled ) { bool replay = false; switch (command) diff --git a/workspace.cpp b/workspace.cpp index 0ceee9a747..031aa28e6e 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -1630,7 +1630,7 @@ void Workspace::checkActiveScreen( const Client* c ) // called e.g. when a user clicks on a window, set active screen to be the screen // where the click occurred -void Workspace::setActiveScreenMouse( QPoint mousepos ) +void Workspace::setActiveScreenMouse( const QPoint &mousepos ) { if( !options->xineramaEnabled ) return; @@ -1644,7 +1644,7 @@ QRect Workspace::screenGeometry( int screen ) const return qApp->desktop()->screenGeometry( screen ); } -int Workspace::screenNumber( QPoint pos ) const +int Workspace::screenNumber( const QPoint &pos ) const { if( !options->xineramaEnabled ) return 0; @@ -1855,7 +1855,7 @@ WId Workspace::getMouseEmulationWindow() /*! Sends a faked mouse event to the specified window. Returns the new button state. */ -unsigned int Workspace::sendFakedMouseEvent( QPoint pos, WId w, MouseEmulation type, int button, unsigned int state ) +unsigned int Workspace::sendFakedMouseEvent( const QPoint &pos, WId w, MouseEmulation type, int button, unsigned int state ) { if ( !w ) return state; diff --git a/workspace.h b/workspace.h index dcaacfbdcb..55fa56a43b 100644 --- a/workspace.h +++ b/workspace.h @@ -153,9 +153,9 @@ class Workspace : public QObject, public KDecorationDefines int activeScreen() const; int numScreens() const; void checkActiveScreen( const Client* c ); - void setActiveScreenMouse( QPoint mousepos ); + void setActiveScreenMouse( const QPoint &mousepos ); QRect screenGeometry( int screen ) const; - int screenNumber( QPoint pos ) const; + int screenNumber( const QPoint &pos ) const; QWidget* desktopWidget(); // for TabBox @@ -529,7 +529,7 @@ class Workspace : public QObject, public KDecorationDefines // mouse emulation WId getMouseEmulationWindow(); enum MouseEmulation { EmuPress, EmuRelease, EmuMove }; - unsigned int sendFakedMouseEvent( QPoint pos, WId win, MouseEmulation type, int button, unsigned int state ); // returns the new state + unsigned int sendFakedMouseEvent( const QPoint &pos, WId win, MouseEmulation type, int button, unsigned int state ); // returns the new state void tabBoxKeyPress( int key ); void tabBoxKeyRelease( const XKeyEvent& ev );