KParts plugin cleanup
Open, Needs TriagePublic

Description

KParts can have plugins associated with them. This is pretty much only used for Konqueror where the various web parts have all kinds of plugins/extensions associated with them. While most of the logic lives in KParts it leaks into KPluginInfo (https://invent.kde.org/frameworks/kservice/-/blob/master/src/services/kplugininfo.h#L212, unused) and KPluginSelector (https://invent.kde.org/frameworks/kcmutils/-/blob/master/src/kpluginselector.h#L92, only used in Konqueror).

For the future I have one radical and some less radical alternative proposals:

Radical proposal: Declare the concept of KPart plugins dead and turn the existing ones into Konqueror plugins. Given that KHTMLPart and webkitpart are on the way out we are converging on having a single browser part. That would leave webenginepart and dolphinpart as the sole consumers of these plugins.

Less radical proposals:
If we decide we still want to stick to the concept of KPart plugins then there is some cleanup in order.

Related Objects

StatusAssignedTask
OpenNone
Openalex
nicolasfella updated the task description. (Show Details)
nicolasfella moved this task from Backlog to Needs Input on the KF6 board.Nov 22 2020, 12:12 AM

@stefanocrocco @marten Any input on which of the two proposals sounds best to you?

It seems indeed that konqueror is the only consumer of these plugins, so it would make sense that the plugin loading moves from KParts to Konqueror -- either the current mechanism, or a more standard JSON-based pluginloader mechanism.

I assume you mean plugins like babelfish, uachanger, webarchiver etc - which in theory could be used by any application which hosts the corresponding KPart but in practice are only used by Konqueror.

If this is so then I'd support the first proposal. It doesn't make sense to have to install the same plugin binary in three separate locations (to support the 3 available HTML parts, even if two are deprecated), and there is the well established JSON plugin loader used everywhere else.

Don't tie it to WebEngine and make it impossible to support any other HTML part, though, as WebEngine is still very resource heavy and hard to build on non-Linux systems. Right now I'm typing this in WebKit...

I'm all right with both approaches. My only worry with the more radical one is that going that way, you'll take away the option to use KParts plugins from future applications. If you think it unlikely that there'll be other applications needing this feature, however, I'm not against it.

dfaure added a comment.Apr 3 2021, 8:41 AM

It seems clear to me that only konqueror uses the KParts Plugins feature:

cd $KDEDIR/share ; find -name kpartplugins
./khtml/kpartplugins
./webenginepart/kpartplugins
./dolphinpart/kpartplugins
./kwebkitpart/kpartplugins
./konqueror/kpartplugins

dfaure moved this task from Needs Input to Backlog on the KF6 board.Apr 3 2021, 1:52 PM
dfaure added a comment.Apr 8 2021, 9:53 AM

One solution is to just move the kpartsplugins/ loading code to Konqueror.
The other is to implement a whole new plugin mechanism.
Unless someone is interested in redesigning the whole mechanism, I'd say we should go with "moving" the code (copying and deprecating).
Opinions?

Unless someone is interested in redesigning the whole mechanism, I'd say we should go with "moving" the code (copying and deprecating).
Opinions?

I agree

I'd be happy with that approach too.

alex moved this task from Backlog to Needs Input on the KF6 board.Nov 21 2021, 6:07 AM
alex added a subscriber: alex.

One solution is to just move the kpartsplugins/ loading code to Konqueror.

This means copying the PartBase::loadPlugins and copying the Plugin class over?

I am not sure about the setPluginLoadingMode stuff, when we deprecate it in KParts we would always need to load the plugins manually, right?

alex claimed this task.Dec 10 2021, 7:26 PM
alex moved this task from Needs Input to In Progress on the KF6 board.

I am not sure about the setPluginLoadingMode stuff, when we deprecate it in KParts we would always need to load the plugins manually, right?

Doing this in the plugin factory seems to work.

I am working on this task as of now.

All the above MRs landed, this waits now only for KF6 branching.

alex added a comment.Dec 22 2021, 8:46 AM

KTorrent also uses those plugins, https://invent.kde.org/network/ktorrent/-/merge_requests/53 cleans that up

alex moved this task from Waiting on KF6 Branching to Done on the KF6 board.Feb 7 2023, 7:26 AM