summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kde-frameworks/kirigami/files/kirigami-5.74.0-remove-actions-from-ToolBarLayout-when-destroyed.patch40
-rw-r--r--kde-frameworks/kirigami/kirigami-5.74.0-r1.ebuild5
2 files changed, 44 insertions, 1 deletions
diff --git a/kde-frameworks/kirigami/files/kirigami-5.74.0-remove-actions-from-ToolBarLayout-when-destroyed.patch b/kde-frameworks/kirigami/files/kirigami-5.74.0-remove-actions-from-ToolBarLayout-when-destroyed.patch
new file mode 100644
index 00000000000..192ba9dcf67
--- /dev/null
+++ b/kde-frameworks/kirigami/files/kirigami-5.74.0-remove-actions-from-ToolBarLayout-when-destroyed.patch
@@ -0,0 +1,40 @@
+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();
+ }
+
+--
+GitLab
+
diff --git a/kde-frameworks/kirigami/kirigami-5.74.0-r1.ebuild b/kde-frameworks/kirigami/kirigami-5.74.0-r1.ebuild
index aa5b71a3f17..0064f84f415 100644
--- a/kde-frameworks/kirigami/kirigami-5.74.0-r1.ebuild
+++ b/kde-frameworks/kirigami/kirigami-5.74.0-r1.ebuild
@@ -37,7 +37,10 @@ RDEPEND="${DEPEND}
# requires package to already be installed
RESTRICT+=" test"
-PATCHES=( "${FILESDIR}"/${P}-revert-fix-avatar-loading.patch )
+PATCHES=(
+ "${FILESDIR}"/${P}-revert-fix-avatar-loading.patch
+ "${FILESDIR}"/${P}-remove-actions-from-ToolBarLayout-when-destroyed.patch
+)
src_configure() {
local mycmakeargs=(