┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/selectionmode/actiontexthelper.cpp
diff options
context:
space:
mode:
authorFelix Ernst <[email protected]>2022-04-25 12:52:05 +0200
committerFelix Ernst <[email protected]>2022-08-14 14:42:40 +0000
commit78cffd2979a6ed87e044fcb024cf4fdfc5c7cb3d (patch)
tree7e5b66a5b4fc8c3328949d80898be2d1d57da5b7 /src/selectionmode/actiontexthelper.cpp
parent8e55f2c2409fd6ca9ebc66a6568f4d3bcbef7576 (diff)
Improve code quality
Diffstat (limited to 'src/selectionmode/actiontexthelper.cpp')
-rw-r--r--src/selectionmode/actiontexthelper.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/selectionmode/actiontexthelper.cpp b/src/selectionmode/actiontexthelper.cpp
index 3eb868a8c..103604236 100644
--- a/src/selectionmode/actiontexthelper.cpp
+++ b/src/selectionmode/actiontexthelper.cpp
@@ -22,10 +22,13 @@ void ActionTextHelper::registerTextWhenNothingIsSelected(QAction *action, QStrin
void ActionTextHelper::textsWhenNothingIsSelectedEnabled(bool enabled)
{
for (auto i = m_registeredActionTextChanges.begin(); i != m_registeredActionTextChanges.end(); ++i) {
- if (!i->action) {
+ while (!i->action) {
i = m_registeredActionTextChanges.erase(i);
- continue;
+ if (i == m_registeredActionTextChanges.end()) {
+ break;
+ }
}
+
if (enabled && i->textStateOfRegisteredText == TextWhenNothingIsSelected) {
QString textWhenSomethingIsSelected = i->action->text();
i->action->setText(i->registeredText);