Commit 0f642449 authored by Ahmad Samir's avatar Ahmad Samir
Browse files

SessionController: iterate over a const container

Also remove the action from the menu then delete it.
parent 043c424a
......@@ -1826,13 +1826,14 @@ void SessionController::showDisplayContextMenu(const QPoint& position)
if (!popup.isNull()) {
delete contentSeparator;
// Remove the 'Open with' actions from it.
QList<QAction*> toDelete;
for (auto *action : popup->actions()) {
const auto actList = popup->actions();
for (auto *action : actList) {
if (action->text().toLower().remove(QLatin1Char('&')).contains(i18n("open with"))) {
toDelete.append(action);
popup->removeAction(action);
action = nullptr;
delete action;
}
}
qDeleteAll(toDelete);
// Remove the Accelerator for the copy shortcut so we don't have two actions with same shortcut.
copy->setShortcut({});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment