Skip to content
Snippets Groups Projects
Commit 5b5b5be4 authored by Harald Sitter's avatar Harald Sitter 🍌
Browse files

Revert "backport patch"

Not applicable to git master (heading for 5.75)

This reverts commit 6a48d58e.
parent 6a48d58e
No related branches found
No related tags found
No related merge requests found
From 6eaefba5001445fa7e198e4caa0bde738240d66f Mon Sep 17 00:00:00 2001
From: Arjen Hiemstra <ahiemstra@heimr.nl>
Date: Wed, 9 Sep 2020 13:00:59 +0200
Subject: [PATCH] Remove actions and delegates from ToolBarLayout when they get
destroyed
Otherwise we're keeping around stale entries that no longer point to
valid stuff.
BUG: 425670
---
src/toolbarlayout.cpp | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/toolbarlayout.cpp b/src/toolbarlayout.cpp
index cbf31062..c2df5998 100644
--- a/src/toolbarlayout.cpp
+++ b/src/toolbarlayout.cpp
@@ -112,6 +112,18 @@ void ToolBarLayout::addAction(QObject* action)
d->actions.append(action);
d->actionsChanged = true;
+ connect(action, &QObject::destroyed, this, [this](QObject *action) {
+ auto itr = d->delegates.find(action);
+ if (itr != d->delegates.end()) {
+ d->delegates.erase(itr);
+ }
+
+ d->actions.removeOne(action);
+ d->actionsChanged = true;
+
+ relayout();
+ });
+
relayout();
}
--
2.25.1
# backport
0001-Remove-actions-and-delegates-from-ToolBarLayout-when.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment