diff --git a/src/backends/libinput/device.cpp b/src/backends/libinput/device.cpp index 12647429b6..342a2b9d0a 100644 --- a/src/backends/libinput/device.cpp +++ b/src/backends/libinput/device.cpp @@ -121,7 +121,7 @@ struct ConfigData { : key(_key) { quint32Setter.setter = _setter; quint32Setter.defaultValue = _defaultValue; } - explicit ConfigData(QByteArray _key, void (Device::*_setter)(QString), QString (Device::*_defaultValue)() const = nullptr) + explicit ConfigData(QByteArray _key, void (Device::*_setter)(const QString&), QString (Device::*_defaultValue)() const = nullptr) : key(_key) { stringSetter.setter = _setter; stringSetter.defaultValue = _defaultValue; } @@ -153,7 +153,7 @@ struct ConfigData { quint32 (Device::*defaultValue)() const; } quint32Setter; struct { - void (Device::*setter)(QString) = nullptr; + void (Device::*setter)(const QString&) = nullptr; QString (Device::*defaultValue)() const; } stringSetter; struct { @@ -660,7 +660,7 @@ void Device::setOrientation(Qt::ScreenOrientation orientation) } } -void Device::setOutputName(QString name) +void Device::setOutputName(const QString &name) { #ifndef KWIN_BUILD_TESTING if (name.isEmpty()) { diff --git a/src/backends/libinput/device.h b/src/backends/libinput/device.h index 251733086b..ce6e58b84b 100644 --- a/src/backends/libinput/device.h +++ b/src/backends/libinput/device.h @@ -384,7 +384,7 @@ public: * @param acceleration mapped to range [-1,1] with -1 being the slowest, 1 being the fastest supported acceleration. */ void setPointerAcceleration(qreal acceleration); - void setPointerAccelerationFromString(QString acceleration) { + void setPointerAccelerationFromString(const QString &acceleration) { setPointerAcceleration(acceleration.toDouble()); } QString defaultPointerAccelerationToString() const { @@ -473,7 +473,7 @@ public: /** * Used to deserialize monitor data from KConfig when initializing a device */ - void setOutputName(QString uuid); + void setOutputName(const QString &uuid); QString defaultOutputName() const { return {};