summaryrefslogtreecommitdiffstats
path: root/src/widget/wpushbutton.cpp
diff options
context:
space:
mode:
authorJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-11-17 20:02:14 +0100
committerJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-11-19 19:46:54 +0100
commit4e1bebf0f5e06ecdd99c41771e7b4ee19c0cdcf3 (patch)
treed0e98cee9eef416282049092ea93b0b2b6eb417d /src/widget/wpushbutton.cpp
parent133ea1e3d6547964f014144eee15590ea449c7af (diff)
Pass non-trivial/large function args by reference
Fixes a bunch of `-Wclazy-function-args-by-ref` warnings. See https://github.com/KDE/clazy/blob/master/docs/checks/README-function-args-by-ref.md for details. Most of these changes are automated, using the clazy fixit by setting the `CLAZY_EXPORT_FIXES` before compilation and then running: $ mkdir /tmp/patch $ find ../src -iname "*.yaml" -exec mv {} /tmp/patch \; $ clang-apply-replacements /tmp/patch
Diffstat (limited to 'src/widget/wpushbutton.cpp')
-rw-r--r--src/widget/wpushbutton.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/widget/wpushbutton.cpp b/src/widget/wpushbutton.cpp
index dface204ba..00a8efe5b9 100644
--- a/src/widget/wpushbutton.cpp
+++ b/src/widget/wpushbutton.cpp
@@ -257,8 +257,11 @@ void WPushButton::setStates(int iStates) {
m_align.resize(iStates);
}
-void WPushButton::setPixmap(int iState, bool bPressed, PixmapSource source,
- Paintable::DrawMode mode, double scaleFactor) {
+void WPushButton::setPixmap(int iState,
+ bool bPressed,
+ const PixmapSource& source,
+ Paintable::DrawMode mode,
+ double scaleFactor) {
QVector<PaintablePointer>& pixmaps = bPressed ?
m_pressedPixmaps : m_unpressedPixmaps;
@@ -279,9 +282,9 @@ void WPushButton::setPixmap(int iState, bool bPressed, PixmapSource source,
pixmaps.replace(iState, pPixmap);
}
-void WPushButton::setPixmapBackground(PixmapSource source,
- Paintable::DrawMode mode,
- double scaleFactor) {
+void WPushButton::setPixmapBackground(const PixmapSource& source,
+ Paintable::DrawMode mode,
+ double scaleFactor) {
// Load background pixmap
m_pPixmapBack = WPixmapStore::getPaintable(source, mode, scaleFactor);
if (!source.isEmpty() &&