summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2020-04-15 21:32:09 +0200
committerAndreas Sturmlechner <asturm@gentoo.org>2020-04-16 00:27:20 +0200
commitd05e2833e464fdae89660ebf0cb283f67687582d (patch)
tree9b380f232f088731d55fcf0eb02db55ab62a7feb /kde-apps
parentmedia-sound/yoshimi: remove unused patch(es) (diff)
downloadgentoo-d05e2833e464fdae89660ebf0cb283f67687582d.tar.gz
gentoo-d05e2833e464fdae89660ebf0cb283f67687582d.tar.bz2
gentoo-d05e2833e464fdae89660ebf0cb283f67687582d.zip
kde-apps/konsole: Adapt the code to >=kde-frameworks/kbookmarks-5.69
Tested-by: Michael Mair-Keimberger <m.mairkeimberger@gmail.com> Tested-by: Nils Freydank <holgersson@posteo.de> Package-Manager: Portage-2.3.99, Repoman-2.3.22 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'kde-apps')
-rw-r--r--kde-apps/konsole/files/konsole-19.12.3-kf5bookmarks-5.69.patch117
-rw-r--r--kde-apps/konsole/konsole-19.12.3-r1.ebuild69
2 files changed, 186 insertions, 0 deletions
diff --git a/kde-apps/konsole/files/konsole-19.12.3-kf5bookmarks-5.69.patch b/kde-apps/konsole/files/konsole-19.12.3-kf5bookmarks-5.69.patch
new file mode 100644
index 000000000000..d70a50ea0551
--- /dev/null
+++ b/kde-apps/konsole/files/konsole-19.12.3-kf5bookmarks-5.69.patch
@@ -0,0 +1,117 @@
+From e56c31a961b182663decd44bc57729576446315b Mon Sep 17 00:00:00 2001
+From: Ahmad Samir <a.samirh78@gmail.com>
+Date: Mon, 13 Apr 2020 11:30:47 +0200
+Subject: [PATCH] [BookmarkMenu] Adapt the code to KBookmarks 5.69 changes
+
+Starting from KBookmarks 5.69 the ctor that took a KActionCollection
+parameter has been deprecated, and we need to manually add the various
+bookmark actions to the actionCollection so that they show up in the
+shortcusts editor.
+
+Move the code that overrides the add bookmark shortcut, Ctrl+B, to the
+BookmarkMenu class, so that all the relevant code is in one place.
+
+BUG: 419981
+(cherry picked from commit 6db7f8d2593ccb0238b2b547ed6eaf7da6a26c4c)
+(cherry picked from commit dcf8cf3f2255293da170648f633873aa7c4afcf1)
+---
+ src/BookmarkMenu.cpp | 34 +++++++++++++++++++++++++++++-----
+ src/BookmarkMenu.h | 2 +-
+ src/MainWindow.cpp | 10 ----------
+ 3 files changed, 30 insertions(+), 16 deletions(-)
+
+diff --git a/src/BookmarkMenu.cpp b/src/BookmarkMenu.cpp
+index 77344ad1..5b83ece9 100644
+--- a/src/BookmarkMenu.cpp
++++ b/src/BookmarkMenu.cpp
+@@ -21,24 +21,48 @@
+
+ // Own
+ #include "BookmarkMenu.h"
++#include "Shortcut_p.h"
+
+ // KDE
+ #include <KActionCollection>
++#include <kbookmarks_version.h>
++#include <KBookmarkManager>
++#include <KBookmark>
+
+ // Qt
+ #include <QAction>
+-#include <KBookmarkManager>
+-#include <KBookmark>
++#include <QMenu>
+
+ #include <algorithm> // std::any_of
+
+-BookmarkMenu::BookmarkMenu (KBookmarkManager *mgr, KBookmarkOwner *owner, QMenu *parentMenu, KActionCollection *collec) :
+- KBookmarkMenu (mgr, owner, parentMenu, collec)
++BookmarkMenu::BookmarkMenu (KBookmarkManager *mgr, KBookmarkOwner *owner, QMenu *parentMenu, KActionCollection *collection) :
++#if KBOOKMARKS_VERSION < QT_VERSION_CHECK(5, 69, 0)
++ KBookmarkMenu (mgr, owner, parentMenu, collection)
++#else
++ KBookmarkMenu (mgr, owner, parentMenu)
++#endif
+ {
++ QAction *bookmarkAction;
++#if KBOOKMARKS_VERSION < QT_VERSION_CHECK(5, 69, 0)
++ bookmarkAction = collection->action(QStringLiteral("add_bookmark"));
++#else
++ collection->addActions(parentMenu->actions());
++
++ bookmarkAction = addBookmarkAction();
++#endif
++
++ Q_ASSERT(bookmarkAction);
++
+ // We need to hijack the action - note this only hijacks top-level action
+- QAction *bookmarkAction = collec->action(QStringLiteral("add_bookmark"));
+ disconnect(bookmarkAction, nullptr, this, nullptr);
+ connect(bookmarkAction, &QAction::triggered, this, &BookmarkMenu::maybeAddBookmark);
++
++ // replace Ctrl+B shortcut for bookmarks only if user hasn't already
++ // changed the shortcut; however, if the user changed it to Ctrl+B
++ // this will still get changed to Ctrl+Shift+B
++ if (bookmarkAction->shortcut() == QKeySequence(Konsole::ACCEL + Qt::Key_B)) {
++ collection->setDefaultShortcut(bookmarkAction, Konsole::ACCEL + Qt::SHIFT + Qt::Key_B);
++ }
+ }
+
+ void BookmarkMenu::maybeAddBookmark()
+diff --git a/src/BookmarkMenu.h b/src/BookmarkMenu.h
+index a42eab23..fde893c0 100644
+--- a/src/BookmarkMenu.h
++++ b/src/BookmarkMenu.h
+@@ -39,7 +39,7 @@ class KONSOLEPRIVATE_EXPORT BookmarkMenu : public KBookmarkMenu
+ Q_OBJECT
+
+ public:
+- BookmarkMenu (KBookmarkManager *mgr, KBookmarkOwner *owner, QMenu *parentMenu, KActionCollection *collec);
++ BookmarkMenu (KBookmarkManager *mgr, KBookmarkOwner *owner, QMenu *parentMenu, KActionCollection *collection);
+
+ private Q_SLOTS:
+ void maybeAddBookmark();
+diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp
+index 461b9e54..90bbf5ed 100644
+--- a/src/MainWindow.cpp
++++ b/src/MainWindow.cpp
+@@ -190,16 +190,6 @@ void MainWindow::correctStandardShortcuts()
+ if (helpAction != nullptr) {
+ actionCollection()->setDefaultShortcut(helpAction, QKeySequence());
+ }
+-
+- // replace Ctrl+B shortcut for bookmarks only if user hasn't already
+- // changed the shortcut; however, if the user changed it to Ctrl+B
+- // this will still get changed to Ctrl+Shift+B
+- QAction *bookmarkAction = actionCollection()->action(QStringLiteral("add_bookmark"));
+- if ((bookmarkAction != nullptr)
+- && bookmarkAction->shortcut() == QKeySequence(Konsole::ACCEL + Qt::Key_B)) {
+- actionCollection()->setDefaultShortcut(bookmarkAction,
+- Konsole::ACCEL + Qt::SHIFT + Qt::Key_B);
+- }
+ }
+
+ ViewManager *MainWindow::viewManager() const
+--
+2.26.1
+
diff --git a/kde-apps/konsole/konsole-19.12.3-r1.ebuild b/kde-apps/konsole/konsole-19.12.3-r1.ebuild
new file mode 100644
index 000000000000..d3f4cb95ef1e
--- /dev/null
+++ b/kde-apps/konsole/konsole-19.12.3-r1.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+ECM_HANDBOOK="optional"
+ECM_TEST="true"
+KFMIN=5.63.0
+QTMIN=5.12.3
+VIRTUALX_REQUIRED="test"
+inherit ecm kde.org
+
+DESCRIPTION="KDE's terminal emulator"
+HOMEPAGE="https://kde.org/applications/system/org.kde.konsole
+https://konsole.kde.org"
+
+LICENSE="GPL-2" # TODO: CHECK
+SLOT="5"
+KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
+IUSE="X"
+
+# drop kbookmarks subslot operator when KFMIN >= 5.69.0
+DEPEND="
+ >=dev-qt/qtdbus-${QTMIN}:5
+ >=dev-qt/qtgui-${QTMIN}:5
+ >=dev-qt/qtnetwork-${QTMIN}:5
+ >=dev-qt/qtprintsupport-${QTMIN}:5
+ >=dev-qt/qtwidgets-${QTMIN}:5
+ >=dev-qt/qtxml-${QTMIN}:5
+ >=kde-frameworks/kbookmarks-${KFMIN}:5=
+ >=kde-frameworks/kcompletion-${KFMIN}:5
+ >=kde-frameworks/kconfig-${KFMIN}:5
+ >=kde-frameworks/kconfigwidgets-${KFMIN}:5
+ >=kde-frameworks/kcoreaddons-${KFMIN}:5
+ >=kde-frameworks/kcrash-${KFMIN}:5
+ >=kde-frameworks/kdbusaddons-${KFMIN}:5
+ >=kde-frameworks/kguiaddons-${KFMIN}:5
+ >=kde-frameworks/kjobwidgets-${KFMIN}:5
+ >=kde-frameworks/ki18n-${KFMIN}:5
+ >=kde-frameworks/kinit-${KFMIN}:5
+ >=kde-frameworks/kiconthemes-${KFMIN}:5
+ >=kde-frameworks/kio-${KFMIN}:5
+ >=kde-frameworks/knewstuff-${KFMIN}:5
+ >=kde-frameworks/knotifications-${KFMIN}:5
+ >=kde-frameworks/knotifyconfig-${KFMIN}:5
+ >=kde-frameworks/kparts-${KFMIN}:5
+ >=kde-frameworks/kpty-${KFMIN}:5
+ >=kde-frameworks/kservice-${KFMIN}:5
+ >=kde-frameworks/ktextwidgets-${KFMIN}:5
+ >=kde-frameworks/kwidgetsaddons-${KFMIN}:5
+ >=kde-frameworks/kwindowsystem-${KFMIN}:5
+ >=kde-frameworks/kxmlgui-${KFMIN}:5
+ X? ( x11-libs/libX11 )
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-19.12.2-darkbackground-detect.patch"
+ "${FILESDIR}/${P}-no-ccache.patch"
+ "${FILESDIR}/${P}-kf5bookmarks-5.69.patch" # KDE-Bug 419981
+)
+
+src_configure() {
+ local mycmakeargs=(
+ $(cmake_use_find_package X X11)
+ )
+
+ ecm_src_configure
+}