Skip to content

Remove "ServiceTypes=KTorrent/Plugin" from plugins' desktop files

Alexander Trufanov requested to merge (removed):plugin_desktop into master

These lines emit multiple warnings like:

[ 52%] Generating ktorrent_mediaplayer.json
Warning: Unable to find service type for service "KTorrent/Plugin" listed in "/home/truf/dev/kde/ktorrent/plugins/mediaplayer/ktorrent_mediaplayer.desktop" ((null):0, (null))
Generated  "/home/t/dev/kde/ktorrent/build/plugins/mediaplayer/ktorrent_mediaplayer.json"
...
[ 75%] Generating ktorrent_magnetgenerator.json
Warning: Unable to find service type for service "KTorrent/Plugin" listed in "/home/truf/dev/kde/ktorrent/plugins/magnetgenerator/ktorrent_magnetgenerator.desktop" ((null):0, (null))
Generated  "/home/t/dev/kde/ktorrent/build/plugins/magnetgenerator/ktorrent_magnetgenerator.json"

during compilation.

As I understand, that's because system has no ktorrentplugin.desktop file installed. Its installation had been disabled and file deleted with following commit: https://github.com/KDE/ktorrent/commit/346af4f190a96105639b75bed72284bd9b83b2cf#diff-a5ff0e6e50679e39538c8d0edf50b063

Currently plugins are loaded with KPluginLoader::findPlugins(QStringLiteral("ktorrent")) where "ktorrent" is a subfolder. Which docs says "Only plugins which have JSON metadata will be considered". JSON metadata is generated from desktop files with kcoreaddons_desktop_to_json() in CMakeList.txt's. And this step produces warnings.

KPluginMetadata::serviceTypes() docs says "This is mostly for historical / compatibility purposes. As a general rule, instead of opening many plugins to then filter by servicetype, put all plugins of the same type in a subdirectory, that you can pass to findPlugins directly. No point in opening 20 plugins to pick out only 3, when the filesystem can do that filtering for you."

So it seems KTorrent doesn't use ServiceTypes relying on subfolders approach. Also it doesn't install ktorrentplugin.desktop which would supress the warnings at kcoreaddons_desktop_to_json() during compillation.

Merge request reports