[neon-notifications] [neon/kde/kirigami/Neon/release] debian/patches: backport patch
Harald Sitter
null at kde.org
Thu Sep 24 13:22:09 BST 2020
Git commit 6a48d58e1fba2c525f73dffa4db60463533ae089 by Harald Sitter.
Committed on 24/09/2020 at 12:21.
Pushed by sitter into branch 'Neon/release'.
backport patch
A +40 -0 debian/patches/0001-Remove-actions-and-delegates-from-ToolBarLayout-when.patch
A +2 -0 debian/patches/series
https://invent.kde.org/neon/kde/kirigami/commit/6a48d58e1fba2c525f73dffa4db60463533ae089
diff --git a/debian/patches/0001-Remove-actions-and-delegates-from-ToolBarLayout-when.patch b/debian/patches/0001-Remove-actions-and-delegates-from-ToolBarLayout-when.patch
new file mode 100644
index 0000000..81d897d
--- /dev/null
+++ b/debian/patches/0001-Remove-actions-and-delegates-from-ToolBarLayout-when.patch
@@ -0,0 +1,40 @@
+From 6eaefba5001445fa7e198e4caa0bde738240d66f Mon Sep 17 00:00:00 2001
+From: Arjen Hiemstra <ahiemstra at 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
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..9260503
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+# backport
+0001-Remove-actions-and-delegates-from-ToolBarLayout-when.patch
More information about the neon-notifications
mailing list