Unify logic for launching KCMs
Open, Needs TriagePublic

Description

A lot of places launch kcmshell5 to display a specific KCM. That is often done using KToolInvocation::kdeinitExec or KIO::CommandLauncherJob.

In Plasma we tend to want to open KCMs with systemsettings instead of kcmshell5, but often a fallback is needed when that isn't available.

A KCMLauncherJob on top of KIO::CommandLauncherJob would be a good place to unify that logic

alex added a subscriber: alex.Apr 29 2021, 3:10 PM

In Plasma we tend to want to open KCMs with systemsettings instead of kcmshell5, but often a fallback is needed when that isn't available.

In https://invent.kde.org/frameworks/kservice/-/merge_requests/16#note_116678 I suggested this but it was not considered an issue.

The MR above could easily be extended for that functionality, this way we could get the service for the KCM and be sure that the exec value is properly set.

With that in mind I would argue that we don't need a dedicated job for it, but feel free to disagree ;-)

dfaure added a subscriber: dfaure.May 2 2021, 9:27 AM

Re-reading my reply in that MR, I am very unsure of what I meant. I think I was only talking about the technicalities of an empty Exec line for a Type=Service desktop file. Please do not treat that as a decision in any direction, I don't have experience with the question of "kcmshell is available but systemsettings isn't".

About this issue, there are currently three ways to launch a KCM, maybe more if we include Plasma::AppletConfiguration.

  • systemsettings: the preferred way, but it requires systemsettings to be installed
  • kcmshell: as a fallback, but this is included in kde-cli-tools, which some modules prefer to avoid as a hard dependency (examples kwin and kdeconnect)
  • invoking KCMultiDialog directly (dependency on kcm-utils, but that is necessary anyway to have a KCM).

What I find desirable is to have a common way to launch the KCM without having to implement custom logic on every module that goes a bit "out-of-the-box". That would simplify enormously how to handle those cases and also a consistant behavior.

alex renamed this task from Create KCMLauncherJob to Unify logic for launching KCMs.May 7 2021, 9:19 AM
alex claimed this task.May 7 2021, 9:21 AM
alex moved this task from Backlog to Done on the KF6 board.

With https://invent.kde.org/frameworks/kservice/-/merge_requests/49 kcmshell5 is used as a fallback. Especially with T14427 this makes sense.

The KCMs can now be launched using the ApplicationLaucherJob and KService will take care of choosing the right executable.