On dinsdag 11 juli 2017 13:41:17 CEST Harald Sitter wrote: > 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/ This would make sense and allow 3rd party tools using SPDX keys to make sense of X-KDE-PluginInfo-License keys, indeed. I think it's useful. > (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) It does parse "and later", it's indicated by the + sign, but it's not reflected in the enum, GPLv2+ would be mapped to GPLv2, so you're right, our current system is lacking in that regard (but could be extended, although I don't know what would break then. Cheers, -- sebas http://www.kde.org | http://vizZzion.org