From 1acd0dfe09a34817d8daf58db2c53b2262eec7b7 Mon Sep 17 00:00:00 2001 From: Méven Car Date: Thu, 22 Jan 2026 16:15:09 +0100 Subject: clang-tidy: avoid copy, use const references --- src/selectionmode/actiontexthelper.cpp | 2 +- src/selectionmode/actiontexthelper.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/selectionmode') diff --git a/src/selectionmode/actiontexthelper.cpp b/src/selectionmode/actiontexthelper.cpp index 1e331860a..0f7318db8 100644 --- a/src/selectionmode/actiontexthelper.cpp +++ b/src/selectionmode/actiontexthelper.cpp @@ -14,7 +14,7 @@ ActionTextHelper::ActionTextHelper(QObject *parent) { } -void ActionTextHelper::registerTextWhenNothingIsSelected(QAction *action, QString registeredText) +void ActionTextHelper::registerTextWhenNothingIsSelected(QAction *action, const QString ®isteredText) { Q_ASSERT(action); m_registeredActionTextChanges.emplace_back(action, registeredText, TextWhenNothingIsSelected); diff --git a/src/selectionmode/actiontexthelper.h b/src/selectionmode/actiontexthelper.h index aa6569411..17cff6e7e 100644 --- a/src/selectionmode/actiontexthelper.h +++ b/src/selectionmode/actiontexthelper.h @@ -33,7 +33,7 @@ public: * The texts can be changed back by calling textsWhenNothingIsSelectedEnabled(false). * @see textsWhenNothingIsSelectedEnabled() */ - void registerTextWhenNothingIsSelected(QAction *action, QString registeredText); + void registerTextWhenNothingIsSelected(QAction *action, const QString ®isteredText); /** * Changes all texts that were registered previously using registerTextWhenNothingIsSelected() to those @@ -57,8 +57,8 @@ private: RegisteredActionTextChange(QAction *action, QString registeredText, TextState state) : action{action} - , registeredText{registeredText} - , textStateOfRegisteredText{state} {}; + , registeredText{std::move(std::move(registeredText))} + , textStateOfRegisteredText{state} { }; }; /** -- cgit v1.3