summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@qt.io>2020-08-25 17:15:51 +0200
committerKai Koehne <kai.koehne@qt.io>2020-09-07 19:17:33 +0200
commit43fc39462a72b0f098a6d1412c0b150b2d4942e7 (patch)
tree2d7881119f827dbb991a68ae52364ed81e7e4c7d
parentae8239a53ea9c512d60f54903c741aab33a6b439 (diff)
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/ Pick-to: 5.15 Change-Id: Ibf42f00452dbf5d28318b3217a9fe74e33f7c97c Reviewed-by: Paul Wicking <paul.wicking@qt.io>
-rw-r--r--src/qtattributionsscanner/qdocgenerator.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/qtattributionsscanner/qdocgenerator.cpp b/src/qtattributionsscanner/qdocgenerator.cpp
index c3d2302d1..701aa8530 100644
--- a/src/qtattributionsscanner/qdocgenerator.cpp
+++ b/src/qtattributionsscanner/qdocgenerator.cpp
@@ -148,11 +148,15 @@ static void generate(QTextStream &out, const Package &package, const QDir &baseD
if (!copyright.isEmpty())
out << "\n\\badcode\n" << 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";
+ }
foreach (const QString &licenseFile, package.licenseFiles) {
QFile file(licenseFile);