Bug 482216 - Hiding .desktop file services from context menu does not work
Summary: Hiding .desktop file services from context menu does not work
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 24.02.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2024-03-02 08:59 UTC by harle-quin
Modified: 2024-03-05 20:33 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
possible fix (kio) (783 bytes, patch)
2024-03-02 08:59 UTC, harle-quin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description harle-quin 2024-03-02 08:59:47 UTC
Created attachment 166294 [details]
possible fix (kio)

SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. install a service .desktop file (into ~/.local/share/kio/servicemenus/)
2. open dolphin settings -> context menu page
3. uncheck previously installed service menu entry

OBSERVED RESULT
the service entry is still present in the context menu for applicable files

EXPECTED RESULT
the service entry should not be shown in the context menu


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 6.0.0
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2

ADDITIONAL INFORMATION
The problem seems to be that Dolphin uses KServiceAction::name() to identify the action in kservicemenurc, but in KIO KDesktopFileAction::name() is used which does not give the same value, but KDesktopFileAction::actionsKey() would.

The attached patch fixes the problem, but I don't know what value is expected in the excludeList. It is not set by Dolphin, but probably the actionsKey is expected as well.

Note that you need to restart Dolphin for the context menu settings changes to take effect.
Comment 1 fanzhuyifan 2024-03-02 19:16:29 UTC
Would you be interested in submitting a merge request? More information can be found at https://community.kde.org/Get_Involved/development

Thanks!
Comment 2 Bug Janitor Service 2024-03-03 07:48:12 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1569
Comment 3 Alexander Lohnau 2024-03-05 20:33:15 UTC
Git commit a0abd2cfb50411417de045380cdcd971c2ab8fde by Alexander Lohnau, on behalf of Martin Seher.
Committed on 05/03/2024 at 19:22.
Pushed by alex into branch 'master'.

fix hide service menu items in context menu

M  +1    -1    src/widgets/kfileitemactions.cpp

https://invent.kde.org/frameworks/kio/-/commit/a0abd2cfb50411417de045380cdcd971c2ab8fde