X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/8e55f2c2409fd6ca9ebc66a6568f4d3bcbef7576..78cffd2979a6ed87e044fcb024cf4fdfc5c7cb3d:/src/selectionmode/actiontexthelper.cpp 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);