krusader/add-service-actions-to-right-click-popup-menu.patch
Luca Beltrame 16f69110c1 Accepting request 447426 from home:wolfi323:branches:KDE:Extra
- Add add-service-actions-to-right-click-popup-menu.patch to add KDE's service actions to the right click popup menu in krusader again (boo#1016980, kde#372231)

OBS-URL: https://build.opensuse.org/request/show/447426
OBS-URL: https://build.opensuse.org/package/show/KDE:Extra/krusader?expand=0&rev=20
2016-12-22 19:03:34 +00:00

79 lines
3.0 KiB
Diff

From 5c6059fbd30365dbd036db556a38019fd7a84872 Mon Sep 17 00:00:00 2001
From: Alexander Bikadorov <alex.bikadorov@kdemail.net>
Date: Wed, 16 Nov 2016 16:39:40 +0100
Subject: FIXED: [ 372231 ] Added KDE's service actions again to right-click
popup menu
BUG: 372231
KFileItemActions::addServiceActionsTo() is not deprecated so we should continue using it like before.
---
krusader/Panel/krpopupmenu.cpp | 22 ++++++++--------------
krusader/Panel/krpopupmenu.h | 2 +-
2 files changed, 9 insertions(+), 15 deletions(-)
diff --git a/krusader/Panel/krpopupmenu.cpp b/krusader/Panel/krpopupmenu.cpp
index 7eac4a9..bfb33d1 100644
--- a/krusader/Panel/krpopupmenu.cpp
+++ b/krusader/Panel/krpopupmenu.cpp
@@ -63,9 +63,8 @@ void KrPopupMenu::run(const QPoint &pos, KrPanel *panel)
/**
* Copied from dolphin/src/dolphincontextmenu.cpp and modified to add only compress and extract submenus.
*/
-bool KrPopupMenu::addCompressAndExtractPluginActions()
+void KrPopupMenu::addCompressAndExtractPluginActions()
{
-
KFileItemListProperties props(_items);
QVector<KPluginMetaData> jsonPlugins = KPluginLoader::findPlugins("kf5/kfileitemaction",
@@ -81,8 +80,6 @@ bool KrPopupMenu::addCompressAndExtractPluginActions()
addActions(abstractPlugin->actions(props, this));
}
}
-
- return !jsonPlugins.isEmpty();
}
KrPopupMenu::KrPopupMenu(KrPanel *thePanel, QWidget *parent) : QMenu(parent), panel(thePanel), empty(false),
@@ -189,16 +186,13 @@ KrPopupMenu::KrPopupMenu(KrPanel *thePanel, QWidget *parent) : QMenu(parent), pa
uAct->setText(i18n("User Actions"));
// add compress and extract plugins (if available)
- bool success = addCompressAndExtractPluginActions();
-
- /*
- * When KF 5.25 is adopted by all distros, we can remove these 2 lines (and corresponding code)
- * because since KF 5.25 compress and extract submenus are standalone plugins.
- */
- if (!success) {
- fileItemActions.setItemListProperties(KFileItemListProperties(_items));
- fileItemActions.addServiceActionsTo(this);
- }
+ addCompressAndExtractPluginActions();
+
+ // NOTE: design and usability problem here. Services disabled in kservicemenurc settings won't
+ // be added to the menu. But Krusader does not provide a way do change these settings (only
+ // Dolphin does).
+ fileItemActions.setItemListProperties(KFileItemListProperties(_items));
+ fileItemActions.addServiceActionsTo(this);
addSeparator();
diff --git a/krusader/Panel/krpopupmenu.h b/krusader/Panel/krpopupmenu.h
index 2d16818..b20dcf8 100644
--- a/krusader/Panel/krpopupmenu.h
+++ b/krusader/Panel/krpopupmenu.h
@@ -44,7 +44,7 @@ protected:
void performAction(int id);
void addEmptyMenuEntries(); // adds the choices for a menu without selected items
void addCreateNewMenu(); // adds a "create new" submenu
- bool addCompressAndExtractPluginActions(); // adds various plugin actions
+ void addCompressAndExtractPluginActions(); // adds various plugin actions
enum ID {
OPEN_ID,
--
cgit v0.11.2