┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorToni Asensi Esteve <[email protected]>2021-07-17 19:47:57 +0200
committerToni Asensi Esteve <[email protected]>2021-07-17 19:50:52 +0200
commit3bde6ba13c3ba46369aa2c2e439fbf635c6aedea (patch)
tree96f61dd6d0fc4b4450cd64016a90307e38168295 /src
parent2c7a1f4b4c5a7cfd8cd4ddafbe7ca46f9b968830 (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')
-rw-r--r--src/dolphinrecenttabsmenu.cpp2
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);