KService: deprecate KServiceTypeTrader
Open, Needs TriagePublic

Description

For querying applications use KApplicationTrader.
For plugins use KPluginLoader

Details

mart created this task.Nov 23 2019, 5:02 PM
nicolasfella updated the task description. (Show Details)Dec 16 2020, 3:37 PM
alex added a subscriber: alex.May 5 2021, 3:27 PM

Notes from the KF6 weekly:

It seems KServiceTypeTrader may be still useful.
Related XDG discussion on standard dbus interface to open a terminal and run
commands. This brings the issue on how to select the implementation. The
proposed solution (for now called "intents") looks similar to the idea of
service types.
This will bring something akin to KServiceTypeTraders.
We may just still deprecate it and port it to an intent, which may be
KDE-specific, but still.

nicolasfella added a subscriber: nicolasfella.EditedMay 5 2021, 8:15 PM

I found another use-case for KServiceTypeTrader :) The "Browser Identification" KCM uses KServiceTypeTrader to query a bunch of desktop files that provide user agent suggestions. No binary plugins involved so KPluginLoader does not work.

Before we bring back KServiceTypeTrader from the grave I'd propose to remove the KCM instead since it's usefulness is questionable (see T13853)

alex added a comment.May 21 2021, 8:13 PM

Sth. intersting I wanted to share: The KIO "Web Search Keywords" (X-KDE-ServiceTypes=SearchProvider) do not use the KServiceTypeTrader API, but QStandardPaths instead and to get the entries from kservices5/searchproviders/. Similar to the namespaces in KPluginLoader. In this case the SearchProviderRegistry (which contains the described logic) is a member variable of the KURISearchFilterEngine singleton.

Could that be a solution for the KonqPopupMenu/Plugin service type? This way we would keep the desktop files working and currently the vast majority of these services gets already installed into the ServiceMenus subfolder.

dfaure added a subscriber: dfaure.May 21 2021, 8:30 PM

Obviously search providers used to use KServiceTypeTrader too, but indeed I ported away from that in commit 6246cc48067845208cf5acd8b798abd68349cf18 (D9213)

You're right, the same could be done for other things which are not C++ plugins.

Obviously keeping KServiceTypeTrader is a valid alternative :)
I only wanted to deprecate it because all plugin-loading needs were otherwise covered, forgetting that it's not only used to load plugins.

alex added a comment.EditedMay 22 2021, 5:23 AM

Obviously keeping KServiceTypeTrader is a valid alternative :)

Yep, but keeping it around for just one usecase which can be relatively easily ported away from seems a bit lazy :D

See https://invent.kde.org/frameworks/kio/-/merge_requests/469

alex moved this task from Backlog to Waiting on Other Tasks on the KF6 board.Oct 30 2021, 2:39 PM
alex claimed this task.Nov 20 2021, 6:57 PM
alex moved this task from Waiting on Other Tasks to Done on the KF6 board.Jan 10 2022, 2:32 PM