mirror of
https://github.com/KDE/konsole.git
synced 2025-12-23 23:38:08 -05:00
Avoid copying the object when not needed.
This commit is contained in:
committed by
Christoph Cullmann
parent
4bdcf59579
commit
3da573fc25
@@ -98,7 +98,7 @@ bool ColorSchemeWallpaper::isNull() const
|
||||
return _path.isEmpty();
|
||||
}
|
||||
|
||||
bool ColorSchemeWallpaper::draw(QPainter &painter, const QRect rect, qreal bgColorOpacity, const QColor &backgroundColor)
|
||||
bool ColorSchemeWallpaper::draw(QPainter &painter, const QRect& rect, qreal bgColorOpacity, const QColor &backgroundColor)
|
||||
{
|
||||
if ((_picture == nullptr) || _picture->isNull()) {
|
||||
return false;
|
||||
@@ -163,7 +163,7 @@ qreal ColorSchemeWallpaper::opacity() const
|
||||
return _opacity;
|
||||
}
|
||||
|
||||
QRectF ColorSchemeWallpaper::ScaledRect(const QSize viewportSize, const QSize pictureSize, const QRect rect)
|
||||
QRectF ColorSchemeWallpaper::ScaledRect(const QSize &viewportSize, const QSize &pictureSize, const QRect &rect)
|
||||
{
|
||||
QRectF scaledRect = QRectF();
|
||||
QSize scaledSize = _style == NoScaling ? pictureSize : pictureSize.scaled(viewportSize, RatioMode());
|
||||
@@ -197,7 +197,7 @@ Qt::AspectRatioMode ColorSchemeWallpaper::RatioMode()
|
||||
}
|
||||
}
|
||||
|
||||
QImage ColorSchemeWallpaper::FlipImage(const QImage image, const ColorSchemeWallpaper::FlipType flipType)
|
||||
QImage ColorSchemeWallpaper::FlipImage(const QImage &image, const ColorSchemeWallpaper::FlipType flipType)
|
||||
{
|
||||
switch (flipType) {
|
||||
case Horizontal:
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
void load();
|
||||
|
||||
/** Returns true if wallpaper available and drawn */
|
||||
bool draw(QPainter &painter, const QRect rect, qreal bgColorOpacity, const QColor &backgroundColor);
|
||||
bool draw(QPainter &painter, const QRect& rect, qreal bgColorOpacity, const QColor &backgroundColor);
|
||||
|
||||
bool isNull() const;
|
||||
|
||||
@@ -93,9 +93,9 @@ private:
|
||||
bool _isAnimated;
|
||||
int _frameDelay;
|
||||
|
||||
QRectF ScaledRect(const QSize viewportSize, const QSize pictureSize, const QRect rect);
|
||||
QRectF ScaledRect(const QSize &viewportSize, const QSize &pictureSize, const QRect &rect);
|
||||
Qt::AspectRatioMode RatioMode();
|
||||
QImage FlipImage(const QImage image, const ColorSchemeWallpaper::FlipType flipType);
|
||||
QImage FlipImage(const QImage &image, const ColorSchemeWallpaper::FlipType flipType);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user