From 571f36f1b61d316a2f2ace00fa94ba83ab1ac0a0 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Mon, 18 Jun 2018 18:54:54 +0200 Subject: =?UTF-8?q?Run=20clang-tidy=E2=80=99s=20modernize-pass-by-value=20?= =?UTF-8?q?pass.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This avoids having to pass variables by reference before copying them when calling a constructor. --- src/ui/widget/color-icc-selector.cpp | 11 ++++++----- src/ui/widget/ink-select-one-action.cpp | 3 ++- src/ui/widget/ink-spinscale.cpp | 3 ++- 3 files changed, 10 insertions(+), 7 deletions(-) (limited to 'src/ui/widget') diff --git a/src/ui/widget/color-icc-selector.cpp b/src/ui/widget/color-icc-selector.cpp index bd1cfde1b..9e1a0c05b 100644 --- a/src/ui/widget/color-icc-selector.cpp +++ b/src/ui/widget/color-icc-selector.cpp @@ -3,6 +3,7 @@ #endif #include +#include #include #include @@ -115,9 +116,9 @@ colorspace::Component::Component() { } -colorspace::Component::Component(std::string const &name, std::string const &tip, guint scale) - : name(name) - , tip(tip) +colorspace::Component::Component(std::string name, std::string tip, guint scale) + : name(std::move(name)) + , tip(std::move(tip)) , scale(scale) { } @@ -217,8 +218,8 @@ class ComponentUI { { } - ComponentUI(colorspace::Component const &component) - : _component(component) + ComponentUI(colorspace::Component component) + : _component(std::move(component)) , _adj(nullptr) , _slider(nullptr) , _btn(nullptr) diff --git a/src/ui/widget/ink-select-one-action.cpp b/src/ui/widget/ink-select-one-action.cpp index 9ab4a7f45..b85e9c189 100644 --- a/src/ui/widget/ink-select-one-action.cpp +++ b/src/ui/widget/ink-select-one-action.cpp @@ -20,6 +20,7 @@ #include "ink-select-one-action.h" #include +#include #include #include #include @@ -49,7 +50,7 @@ InkSelectOneAction::InkSelectOneAction (const Glib::ustring &name, _group_label( group_label ), _tooltip( tooltip ), _stock_id( stock_id ), - _store (store), + _store (std::move(store)), _use_radio (true), _use_label (true), _use_icon (true), diff --git a/src/ui/widget/ink-spinscale.cpp b/src/ui/widget/ink-spinscale.cpp index 87a2bd11c..3e075978b 100644 --- a/src/ui/widget/ink-spinscale.cpp +++ b/src/ui/widget/ink-spinscale.cpp @@ -25,6 +25,7 @@ #include #include +#include InkScale::InkScale(Glib::RefPtr adjustment, Gtk::SpinButton* spinbutton) : Glib::ObjectBase("InkScale") @@ -224,7 +225,7 @@ InkSpinScale::InkSpinScale(double value, double lower, } InkSpinScale::InkSpinScale(Glib::RefPtr adjustment) - : _adjustment(adjustment) + : _adjustment(std::move(adjustment)) { set_name("InkSpinScale"); -- cgit v1.2.3