Bug 451523 - Filter external tools based on file type
Summary: Filter external tools based on file type
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: Git
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-15 11:28 UTC by Nicolas Fella
Modified: 2024-09-28 16:53 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Fella 2022-03-15 11:28:39 UTC
STEPS TO REPRODUCE
1. Open a C++ file in Kate
2. Go to Tools > External Tools > Tools

OBSERVED RESULT
Tools that are not relevant for C++ files are shown, e.g. "Format JSON" or "Format XML"

EXPECTED RESULT
Only tools relevant for C++ files are shown

SOFTWARE/OS VERSIONS
KDE Plasma Version: master
KDE Frameworks Version: master
Qt Version: 5.15-kde
Comment 1 Nicolas Fella 2022-03-15 11:34:49 UTC
Looking at External Tools > Configure it looks like tools already are able to filter on target mimetypes, so it's "just" a matter of adding more metadata to the existing tool definitions?
Comment 2 Bug Janitor Service 2024-09-27 12:01:57 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/1602
Comment 3 Christoph Cullmann 2024-09-28 16:53:41 UTC
Git commit 801cf1eae2baf8746ac5d5fb0287f532be78f67b by Christoph Cullmann, on behalf of Waqar Ahmed.
Committed on 28/09/2024 at 16:45.
Pushed by cullmann into branch 'master'.

Show relevant external tools in context menu

Shown in project tree view context menu and Documents context menu.
The tools are filtered by mimetype. Tools which have no mimetype are
always shown.
Related: bug 479027

M  +25   -0    addons/externaltools/kateexternaltoolsview.cpp
M  +6    -0    addons/externaltools/kateexternaltoolsview.h
M  +10   -0    addons/filetree/katefiletree.cpp
M  +14   -0    addons/project/kateprojecttreeviewcontextmenu.cpp
M  +5    -0    addons/project/kateprojectviewtree.cpp
M  +7    -0    addons/project/kateprojectviewtree.h

https://invent.kde.org/utilities/kate/-/commit/801cf1eae2baf8746ac5d5fb0287f532be78f67b