Recognize X-KDE-FormFactor as stringlist
Review Request #124066 - Created June 11, 2015 and submitted
This patch adds X-KDE-FormFactor to the keys recognized as stringlists.
We would like to see this to go in to allow us to filter plugins (KCMs for example) by form factor, so we only display UI plugins that are suitable for a given target device.
The idea is that plugins indicate which form factor (for example media center, tablet, desktop, etc...) they're suitable for, and the "host application" filters based on these.
If this approach is deemed valid, I'd be happy to add convenience API to KPluginMetaData, i.e. QStringList KPluginMetaData::formFactor(). This patch would be the minimal implementation we'd need.
The naming of the key is of course open to better suggestions.
added autotest, also implemented using this in the Plasma Active settings app as proof-of-concept, works like a charm.
I was looking for similar API when implementing plasmoids in pmc. Not all plasmoids would support mediacenter containment, so they might need to tell somehow which formfactors are supported.. About naming, name it X-KDE-SupportedFormFactor maybe?
Also perhaps document what should be possible values of X-KDE-FormFactors somewhere?
I don't really have the overview anymore, but the kdelibs4 solution was fully extensible, a servicetype desktop file could define new keys and their type. It looks like desktopfileparser.cpp doesn't have the same flexibility, if each and every app needs to add their keys to the code :(
Status: Closed (submitted)
Submitted with commit 499c15cccea14f97114a06a64082ac57660926bf by Sebastian Kügler to branch master.
Why don't we store plugin metadata in JSON files? Look how they're used for KDevelop: https://svn.reviewboard.kde.org/r/7126/
I'm afraid that if we keep this patch and it gets released, but then we realize that X-KDE-FormFactor is not necessary in .desktop (e.g. we only have it in plugins that all use .json), afterwards we'll have to support X-KDE-FormFactor in kcoreaddons until the end of the KF5.x series. 5.12 is tagging tomorrow ;)