diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2020-04-25 11:37:10 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2020-04-25 11:37:10 +0100 |
commit | 38423c67c8a23f6a1bc42038193182e2da3116eb (patch) | |
tree | 04e2cf4bd43601b77daa79fe654e409187093c5e /app-text/kjots/files | |
parent | 623ee73d661e5ed8475cb264511f683407d87365 (diff) |
gentoo resync : 25.04.2020
Diffstat (limited to 'app-text/kjots/files')
-rw-r--r-- | app-text/kjots/files/kjots-5.0.2-kf5bookmarks-5.69.patch | 67 |
1 files changed, 67 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 + |