diff options
| author | Toni Asensi Esteve <[email protected]> | 2021-07-17 19:47:57 +0200 |
|---|---|---|
| committer | Toni Asensi Esteve <[email protected]> | 2021-07-17 19:50:52 +0200 |
| commit | 3bde6ba13c3ba46369aa2c2e439fbf635c6aedea (patch) | |
| tree | 96f61dd6d0fc4b4450cd64016a90307e38168295 /src/dolphinrecenttabsmenu.cpp | |
| parent | 2c7a1f4b4c5a7cfd8cd4ddafbe7ca46f9b968830 (diff) | |
Delete some items that were intended to be deleted. Avoid trying to delete items that don't exist
When deleting items of a list, follow a sequence that ensures that the item
that is going to be deleted exists.
Revision: https://invent.kde.org/system/dolphin/-/merge_requests/240
Diffstat (limited to 'src/dolphinrecenttabsmenu.cpp')
| -rw-r--r-- | src/dolphinrecenttabsmenu.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dolphinrecenttabsmenu.cpp b/src/dolphinrecenttabsmenu.cpp index 38eb4f657..d8bd06b5c 100644 --- a/src/dolphinrecenttabsmenu.cpp +++ b/src/dolphinrecenttabsmenu.cpp @@ -66,7 +66,7 @@ void DolphinRecentTabsMenu::handleAction(QAction* action) // action and the separator QList<QAction*> actions = menu()->actions(); const int count = actions.size(); - for (int i = 2; i < count; ++i) { + for (int i = count - 1; i >= 2; i--) { removeAction(actions.at(i)); } Q_EMIT closedTabsCountChanged(0); |
