summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2020-04-21 16:33:22 +0200
committerAndreas Sturmlechner <asturm@gentoo.org>2020-04-21 16:40:52 +0200
commitddbdc7ce709c3f8af620e8d06f5847cbe73ec50e (patch)
treeae181e89d671ae8f071ebfff497b5e60c75a283f /app-text/kjots
parentdev-python/django-tagging: Bump to 0.5.0, py3.{7,8} (diff)
downloadgentoo-ddbdc7ce709c3f8af620e8d06f5847cbe73ec50e.tar.gz
gentoo-ddbdc7ce709c3f8af620e8d06f5847cbe73ec50e.tar.bz2
gentoo-ddbdc7ce709c3f8af620e8d06f5847cbe73ec50e.zip
app-text/kjots: Adapt the code to >=kde-frameworks/kbookmarks-5.69
KDE-Bug: https://bugs.kde.org/show_bug.cgi?id=384000 Package-Manager: Portage-2.3.99, Repoman-2.3.22 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'app-text/kjots')
-rw-r--r--app-text/kjots/files/kjots-5.0.2-kf5bookmarks-5.69.patch67
-rw-r--r--app-text/kjots/kjots-5.0.2-r1.ebuild49
2 files changed, 116 insertions, 0 deletions
diff --git a/app-text/kjots/files/kjots-5.0.2-kf5bookmarks-5.69.patch b/app-text/kjots/files/kjots-5.0.2-kf5bookmarks-5.69.patch
new file mode 100644
index 000000000000..63bda683122f
--- /dev/null
+++ b/app-text/kjots/files/kjots-5.0.2-kf5bookmarks-5.69.patch
@@ -0,0 +1,67 @@
+From ca6f4b963e83ed91cc7314e1b60fe6607b61b53e Mon Sep 17 00:00:00 2001
+From: Igor Poboiko <igor.poboiko@gmail.com>
+Date: Sun, 12 Apr 2020 17:55:24 +0300
+Subject: [KJots] Fix bookmarks actions
+
+Summary:
+This patch ports KJots from deprecated `KBookmarksMenu` API (see {D25660}).
+
+On my machine, it also fixes a crash (`bm_action` was null for some reason,
+I did not investigate it though).
+
+It also fixes the shortcuts collision (`action->setShortcut` was not enough,
+one also needs to run `actionCollection->setDefaultShortcut`).
+
+BUG: 384000
+
+Test Plan:
+1) Start KJots
+2) It don't crash, and `Ambiguous shortcuts` dialog does not appear)
+3) Open `Bookmarks` menu, the shortcut is `Ctrl+Shift+B`.
+
+Reviewers: dvratil
+
+Reviewed By: dvratil
+
+Subscribers: winterz, kde-pim
+
+Tags: #kde_pim
+
+Differential Revision: https://phabricator.kde.org/D28775
+---
+ src/kjotswidget.cpp | 13 ++++++++-----
+ 1 file changed, 8 insertions(+), 5 deletions(-)
+
+diff --git a/src/kjotswidget.cpp b/src/kjotswidget.cpp
+index 865129b..e343bbd 100644
+--- a/src/kjotswidget.cpp
++++ b/src/kjotswidget.cpp
+@@ -353,17 +353,20 @@ KJotsWidget::KJotsWidget(QWidget *parent, KXMLGUIClient *xmlGuiClient, Qt::Windo
+ bookmarkMenu = actionCollection->add<KActionMenu>(QLatin1String("bookmarks"));
+ bookmarkMenu->setText(i18n("&Bookmarks"));
+ KJotsBookmarks *bookmarks = new KJotsBookmarks(treeview);
+- /*KBookmarkMenu *bmm =*/ new KBookmarkMenu(
++ KBookmarkMenu *bmm = new KBookmarkMenu(
+ KBookmarkManager::managerForFile(
+ QStandardPaths::standardLocations(QStandardPaths::AppDataLocation).first() + QStringLiteral("/kjots/bookmarks.xml"),
+ QStringLiteral("kjots")),
+- bookmarks, bookmarkMenu->menu(), actionCollection);
++ bookmarks, bookmarkMenu->menu());
+
+ // "Add bookmark" and "make text bold" actions have conflicting shortcuts (ctrl + b)
+ // Make add_bookmark use ctrl+shift+b to resolve that.
+- QAction *bm_action = qobject_cast<QAction *>(actionCollection->action(QLatin1String("add_bookmark")));
+- Q_ASSERT(bm_action);
+- bm_action->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_B);
++ QAction *bm_action = bmm->addBookmarkAction();
++ actionCollection->addAction(QStringLiteral("add_bookmark"), bm_action);
++ actionCollection->setDefaultShortcut(bm_action, Qt::CTRL | Qt::SHIFT | Qt::Key_B);
++ actionCollection->addAction(QStringLiteral("edit_bookmark"), bmm->editBookmarksAction());
++ actionCollection->addAction(QStringLiteral("add_bookmarks_list"), bmm->bookmarkTabsAsFolderAction());
++
+
+ KStandardAction::find(this, SLOT(onShowSearch()), actionCollection);
+ action = KStandardAction::findNext(this, SLOT(onRepeatSearch()), actionCollection);
+--
+cgit v1.1
+
diff --git a/app-text/kjots/kjots-5.0.2-r1.ebuild b/app-text/kjots/kjots-5.0.2-r1.ebuild
new file mode 100644
index 000000000000..841544075ce3
--- /dev/null
+++ b/app-text/kjots/kjots-5.0.2-r1.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+KFMIN=5.60.0
+QTMIN=5.12.3
+inherit ecm kde.org
+
+DESCRIPTION="Note taking utility by KDE"
+HOMEPAGE="https://userbase.kde.org/KJots https://community.kde.org/PIM/KJots"
+SRC_URI="mirror://kde/stable/${PN}/${PV}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="5"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+# drop kbookmarks subslot operator when KFMIN >= 5.69.0
+DEPEND="
+ dev-libs/grantlee:5
+ dev-libs/libxslt
+ >=dev-qt/qtdbus-${QTMIN}:5
+ >=dev-qt/qtgui-${QTMIN}:5
+ >=dev-qt/qtprintsupport-${QTMIN}:5
+ >=dev-qt/qtwidgets-${QTMIN}:5
+ >=kde-apps/akonadi-19.04.3:5
+ >=kde-apps/akonadi-notes-19.04.3:5
+ >=kde-apps/kmime-19.04.3:5
+ >=kde-apps/kontactinterface-19.04.3:5
+ >=kde-apps/kpimtextedit-19.04.3:5
+ >=kde-frameworks/kbookmarks-${KFMIN}:5=
+ >=kde-frameworks/kcmutils-${KFMIN}:5
+ >=kde-frameworks/kconfig-${KFMIN}:5
+ >=kde-frameworks/kconfigwidgets-${KFMIN}:5
+ >=kde-frameworks/kcoreaddons-${KFMIN}:5
+ >=kde-frameworks/ki18n-${KFMIN}:5
+ >=kde-frameworks/kio-${KFMIN}:5
+ >=kde-frameworks/kitemmodels-${KFMIN}:5
+ >=kde-frameworks/kparts-${KFMIN}:5
+ >=kde-frameworks/ktextwidgets-${KFMIN}:5
+ >=kde-frameworks/kwidgetsaddons-${KFMIN}:5
+ >=kde-frameworks/kxmlgui-${KFMIN}:5
+"
+RDEPEND="${DEPEND}
+ !app-text/kjots:4
+"
+
+PATCHES=( "${FILESDIR}/${P}-kf5bookmarks-5.69.patch" ) # KDE-Bug 384000