diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2020-11-07 21:31:44 +0100 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2020-11-07 21:48:56 +0100 |
commit | 9fcdb44e55b5bee585e4906e93d055d230ee01d9 (patch) | |
tree | 5e3a65649d9e9b5ea4cd0c9a4ca833cc4e2a6f5a /rbutil/rbutilqt/rbutilqt.cpp | |
parent | db7c4424e463055723edcb30e51c879358ac9831 (diff) | |
download | rockbox-9fcdb44e55b5bee585e4906e93d055d230ee01d9.tar.gz rockbox-9fcdb44e55b5bee585e4906e93d055d230ee01d9.tar.bz2 rockbox-9fcdb44e55b5bee585e4906e93d055d230ee01d9.zip |
rbutil: Show the license of all libraries included.
Replace the Speex license tab in the about dialog with one that lists
all used libraries and their respective licenses, including Speex.
Previously only Speex required including the license in binary
distribution; the recently added bspatch also wants this. Show
the license for all used libraries so we can more easily add new ones in
the future.
Change-Id: Ic8b403f8a2a05d0f1734ddf092782b85ddfa5ed9
Diffstat (limited to 'rbutil/rbutilqt/rbutilqt.cpp')
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.cpp | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp index 60f517825d..1c00ef9a07 100644 --- a/rbutil/rbutilqt/rbutilqt.cpp +++ b/rbutil/rbutilqt/rbutilqt.cpp @@ -282,12 +282,37 @@ void RbUtilQt::about() QTextStream c(&licence); about.browserLicense->insertHtml(c.readAll()); about.browserLicense->moveCursor(QTextCursor::Start, QTextCursor::MoveAnchor); - - QFile speexlicense(":/docs/COPYING.SPEEX"); - speexlicense.open(QIODevice::ReadOnly); - QTextStream s(&speexlicense); - about.browserSpeexLicense->insertHtml("<pre>" + s.readAll() + "</pre>"); - about.browserSpeexLicense->moveCursor(QTextCursor::Start, QTextCursor::MoveAnchor); + licence.close(); + + QString html = "<p>" + tr("Libraries used") + "</p>"; + html += "<ul>"; + html += "<li>Speex: <a href='#speex'>Speex License</a></li>"; + html += "<li>bspatch: <a href='#bspatch'>bspatch License</a></li>"; + html += "<li>bzip2: <a href='#bzip2'>bzip2 License</a></li>"; + html += "<li>mspack: <a href='#lgpl2'>LGPL v2.1 License</a></li>"; + html += "<li>quazip: <a href='#lgpl2'>LGPL v2.1 License</a></li>"; + html += "<li>tomcrypt: <a href='#tomcrypt'>Tomcrypt License</a></li>"; + html += "<li>CuteLogger: <a href='#lgpl2'>LGPL v2.1 License</a></li>"; + html += "</ul>"; + about.browserLicenses->insertHtml(html); + + QMap<QString, QString> licenses; + licenses[":/docs/COPYING.SPEEX"] = "<a id='speex'>Speex License</a>"; + licenses[":/docs/lgpl-2.1.txt"] = "<a id='lgpl2'>LGPL v2.1</a>"; + licenses[":/docs/LICENSE.TOMCRYPT"] = "<a id='tomcrypt'>Tomcrypt License</a>"; + licenses[":/docs/LICENSE.BZIP2"] = "<a id='bzip2'>bzip2 License</a>"; + licenses[":/docs/LICENSE.BSPATCH"] = "<a id='bspatch'>bspatch License</a>"; + + for (int i = 0; i < licenses.size(); i++) { + QString key = licenses.keys().at(i); + QFile license(key); + license.open(QIODevice::ReadOnly); + QTextStream s(&license); + about.browserLicenses->insertHtml("<hr/><h2>" + licenses[key] + "</h2><br/>\n"); + about.browserLicenses->insertHtml("<pre>" + s.readAll() + "</pre>"); + license.close(); + } + about.browserLicenses->moveCursor(QTextCursor::Start, QTextCursor::MoveAnchor); QFile credits(":/docs/CREDITS"); credits.open(QIODevice::ReadOnly); @@ -304,6 +329,7 @@ void RbUtilQt::about() line.remove(QRegExp("^People.*")); about.browserCredits->append(line); } + credits.close(); about.browserCredits->moveCursor(QTextCursor::Start, QTextCursor::MoveAnchor); QString title = QString("<b>The Rockbox Utility</b><br/>Version %1").arg(FULLVERSION); about.labelTitle->setText(title); |