kaboutlicense api extension ::spdxId()?

Harald Sitter sitter at kde.org
Tue Jul 11 11:41:17 UTC 2017


Hola

I was wondering if anyone had an opinion on extending kaboutlicense
with a ::spdxId() instance method returning the license's spdx id [1].

Use case at hand is kpackagetool, which maps X-KDE-PluginInfo-License
of (e.g.) plasma applets to appstream metadata. Appstream however uses
the standardized spdx identifiers so we need a conversion table
somewhere. And here I am thinking why not kaboutlicense itself.

QString KAboutLicense::spdxId() const
{
    switch (d->_licenseKey) {
    case KAboutLicense::File:
        return QStringLiteral("");
    case KAboutLicense::GPL_V2:
        return QStringLiteral("GPL-2.0");
   ...
}

[1] https://spdx.org/licenses/

(on a side node: it may be useful to switch our plugininfos to spdx
ids by default at some point in the future, our current format is not
only deficient in the lack of standardization but also doesn't cover
'and later' qualification at all)


More information about the Kde-frameworks-devel mailing list