kde-frameworks/kbookmarks: Backport Konqueror 20.04.0 fix for KF-5.69
authorAndreas Sturmlechner <asturm@gentoo.org>
Thu, 23 Apr 2020 13:30:49 +0000 (15:30 +0200)
committerAndreas Sturmlechner <asturm@gentoo.org>
Thu, 23 Apr 2020 22:06:58 +0000 (00:06 +0200)
...to fix kde-apps/konqueror-19.12.3, which did not contain the header yet.

KDE-Bug: https://bugs.kde.org/show_bug.cgi?id=420010
Closes: https://bugs.gentoo.org/717316
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
kde-frameworks/kbookmarks/files/kbookmarks-5.69.0-konqbookmarkmenu.patch [new file with mode: 0644]
kde-frameworks/kbookmarks/kbookmarks-5.69.0-r1.ebuild [new file with mode: 0644]

diff --git a/kde-frameworks/kbookmarks/files/kbookmarks-5.69.0-konqbookmarkmenu.patch b/kde-frameworks/kbookmarks/files/kbookmarks-5.69.0-konqbookmarkmenu.patch
new file mode 100644 (file)
index 0000000..c0e68bc
--- /dev/null
@@ -0,0 +1,67 @@
+From 8504e095478b1c922055fc4ae6c736472708fddd Mon Sep 17 00:00:00 2001
+From: Stefano Crocco <stefano.crocco@alice.it>
+Date: Mon, 13 Apr 2020 10:53:06 +0200
+Subject: [PATCH] Fix crash due to changes in KBookmarkMenu
+
+Summary:
+Since version 5.69, KBookmarkMenu doesn't automatically create an action
+collection. This causes Konqueror to crash when going on a submenu in
+the Bookmarks menu. To avoid it, manually create the action collection.
+
+Also, avoid calling the version of KBookmarkMenu construction which
+takes a KActionCollection, as it's deprecated.
+
+Test Plan:
+Open the bookmarks menu and hover with the mouse on a submenu. Check
+that it crashes. Do the same after this change and check it doesn't crash
+anymore.
+
+Reviewers: dfaure, nicolasfella
+
+Reviewed By: nicolasfella
+
+Subscribers: poboiko
+
+Differential Revision: https://phabricator.kde.org/D28789
+
+* asturm, 2020-04-23: This *is* KF-5.69 so no need to check for the
+  version wrt commit b61086cf.
+---
+ src/konqbookmarkmenu.h | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/konqbookmarkmenu.h b/src/konqbookmarkmenu.h
+index 4898c3a..45bdb84 100644
+--- a/src/konqbookmarkmenu.h
++++ b/src/konqbookmarkmenu.h
+@@ -25,6 +25,8 @@
+ #include "kbookmarkactionmenu.h"
+ #include "kbookmarkcontextmenu.h"
++#include <KActionCollection>
++
+ #if KBOOKMARKS_ENABLE_DEPRECATED_SINCE(5, 0)
+ #include "kbookmarkowner.h" // for SC reasons
+@@ -56,8 +58,9 @@ public:
+      */
+     KBOOKMARKS_DEPRECATED_VERSION(5, 65, "This class has moved to Konqueror")
+     KonqBookmarkMenu(KBookmarkManager *mgr, KBookmarkOwner *owner, KBookmarkActionMenu *parentMenu, KActionCollection *collec)
+-        : KBookmarkMenu(mgr, owner, parentMenu->menu(), collec)
++        : KBookmarkMenu(mgr, owner, parentMenu->menu())
+     {
++        m_actionCollection = collec;
+     }
+     ~KonqBookmarkMenu() override
+     {}
+@@ -71,6 +74,7 @@ public:
+     KonqBookmarkMenu(KBookmarkManager *mgr, KBookmarkOwner *owner, KBookmarkActionMenu *parentMenu, QString parentAddress)
+         : KBookmarkMenu(mgr, owner, parentMenu->menu(), parentAddress)
+     {
++        m_actionCollection = new KActionCollection(this);
+     }
+ protected:
+-- 
+2.26.2
+
diff --git a/kde-frameworks/kbookmarks/kbookmarks-5.69.0-r1.ebuild b/kde-frameworks/kbookmarks/kbookmarks-5.69.0-r1.ebuild
new file mode 100644 (file)
index 0000000..886f263
--- /dev/null
@@ -0,0 +1,36 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PVCUT=$(ver_cut 1-2)
+QTMIN=5.12.3
+VIRTUALX_REQUIRED="test"
+inherit ecm kde.org
+
+DESCRIPTION="Framework for managing bookmarks stored in XBEL format"
+
+LICENSE="LGPL-2+"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
+IUSE="nls"
+
+BDEPEND="
+       nls? ( >=dev-qt/linguist-tools-${QTMIN}:5 )
+"
+RDEPEND="
+       >=dev-qt/qtdbus-${QTMIN}:5
+       >=dev-qt/qtgui-${QTMIN}:5
+       >=dev-qt/qtwidgets-${QTMIN}:5
+       >=dev-qt/qtxml-${QTMIN}:5
+       =kde-frameworks/kcodecs-${PVCUT}*:5
+       =kde-frameworks/kconfig-${PVCUT}*:5
+       =kde-frameworks/kcoreaddons-${PVCUT}*:5
+       =kde-frameworks/kiconthemes-${PVCUT}*:5
+       =kde-frameworks/kwidgetsaddons-${PVCUT}*:5
+       =kde-frameworks/kxmlgui-${PVCUT}*:5
+"
+DEPEND="${RDEPEND}
+       >=kde-frameworks/kconfigwidgets-${PVCUT}:5
+"
+
+PATCHES=( "${FILESDIR}/${P}-konqbookmarkmenu.patch" )