┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/selectionmode/actiontexthelper.cpp
diff options
context:
space:
mode:
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);