diff options
author | Kai Koehne <kai.koehne@qt.io> | 2020-08-25 17:15:51 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2020-09-07 18:41:04 +0000 |
commit | 2cea79cfbb237c1f4bdc10619a1ddbdc5c49b39b (patch) | |
tree | 4f2bfe0a3cbd45461d1f35aba3ccaa7ffb246499 | |
parent | 61c794846f3db82a10e5505397adb1b19bd21076 (diff) | |
download | qttools-2cea79cfbb237c1f4bdc10619a1ddbdc5c49b39b.tar.gz |
qtattributionsscanner: Linkify dejacode URN's for LicenseId
So far we only allowed SPDX license ID's. Anyhow, there are some
licenses not represented in SPDX, but in the much vaster DejaCode
database. This is the case e.g. for the Bitstream Vera Font License,
which is tracked in Qt Gui and currently leads to a 404:
https://doc.qt.io/qt-5.15/qtgui-attribution-vera-font.html
To avoid having to flag all such licenses as 'NONE', we now allow
LicenseID to contain URN's of the form urn:dje:license:, see also
https://enterprise.dejacode.com/urn/urn:dje:license/
Change-Id: Ibf42f00452dbf5d28318b3217a9fe74e33f7c97c
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 43fc39462a72b0f098a6d1412c0b150b2d4942e7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/qtattributionsscanner/qdocgenerator.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/qtattributionsscanner/qdocgenerator.cpp b/src/qtattributionsscanner/qdocgenerator.cpp index dfa460f3d..a418dd199 100644 --- a/src/qtattributionsscanner/qdocgenerator.cpp +++ b/src/qtattributionsscanner/qdocgenerator.cpp @@ -130,11 +130,15 @@ static void generate(QTextStream &out, const Package &package, const QDir &baseD if (!package.copyright.isEmpty()) out << "\n\\badcode\n" << package.copyright << "\n\\endcode\n\n"; - if (isSpdxLicenseId(package.licenseId) && package.licenseId != QLatin1String("NONE")) + if (isSpdxLicenseId(package.licenseId) && package.licenseId != QLatin1String("NONE")) { out << "\\l{https://spdx.org/licenses/" << package.licenseId << ".html}" << "{" << package.license << "}.\n\n"; - else + } else if (package.licenseId.startsWith(QLatin1String("urn:dje:license:"))) { + out << "\\l{https://enterprise.dejacode.com/licenses/public/" << package.licenseId.mid(16) + << "/}{" << package.license << "}.\n\n"; + } else { out << package.license << ".\n\n"; + } if (!package.licenseFile.isEmpty()) { QFile file(package.licenseFile); |