konsole: update to 20.04.0
[ci skip]
This commit is contained in:
parent
727fae7f7a
commit
c80125b7c7
2 changed files with 3 additions and 118 deletions
|
@ -1,115 +0,0 @@
|
||||||
From 6db7f8d2593ccb0238b2b547ed6eaf7da6a26c4c Mon Sep 17 00:00:00 2001
|
|
||||||
From: Ahmad Samir <a.samirh78@gmail.com>
|
|
||||||
Date: Mon, 13 Apr 2020 11:30:47 +0200
|
|
||||||
Subject: [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
|
|
||||||
---
|
|
||||||
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 77344ad..5b83ece 100644
|
|
||||||
--- src/BookmarkMenu.cpp
|
|
||||||
+++ 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 a42eab2..fde893c 100644
|
|
||||||
--- src/BookmarkMenu.h
|
|
||||||
+++ 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 e33eefb..17545f3 100644
|
|
||||||
--- src/MainWindow.cpp
|
|
||||||
+++ src/MainWindow.cpp
|
|
||||||
@@ -193,16 +193,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
|
|
||||||
--
|
|
||||||
cgit v1.1
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Template file for 'konsole'
|
# Template file for 'konsole'
|
||||||
pkgname=konsole
|
pkgname=konsole
|
||||||
version=19.12.3
|
version=20.04.0
|
||||||
revision=2
|
revision=1
|
||||||
build_style=cmake
|
build_style=cmake
|
||||||
configure_args="-DBUILD_TESTING=OFF"
|
configure_args="-DBUILD_TESTING=OFF"
|
||||||
hostmakedepends="pkg-config extra-cmake-modules kcoreaddons qt5-devel
|
hostmakedepends="pkg-config extra-cmake-modules kcoreaddons qt5-devel
|
||||||
|
@ -13,7 +13,7 @@ maintainer="John <johnz@posteo.net>"
|
||||||
license="GPL-2.0-or-later, LGPL-2.0-or-later, GFDL-1.2-or-later"
|
license="GPL-2.0-or-later, LGPL-2.0-or-later, GFDL-1.2-or-later"
|
||||||
homepage="https://www.kde.org/applications/system/konsole/"
|
homepage="https://www.kde.org/applications/system/konsole/"
|
||||||
distfiles="${KDE_SITE}/release-service/${version}/src/konsole-${version}.tar.xz"
|
distfiles="${KDE_SITE}/release-service/${version}/src/konsole-${version}.tar.xz"
|
||||||
checksum=0bde8eb6365c53e96489d0ceb05baa0bb0385ee865492622033164a4c4bfccdc
|
checksum=179b2bb442e13c22032e56457986c68074b31a5c2da67e0e6e854658a37e24de
|
||||||
replaces="konsole5>=0"
|
replaces="konsole5>=0"
|
||||||
|
|
||||||
if [ "$CROSS_BUILD" ]; then
|
if [ "$CROSS_BUILD" ]; then
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue