blob: 9cc969708c45f47cac7cfaa4c9d4c808f4021c96 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
// Copyright 2016-2021 The Mumble Developers. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
#include "License.h"
#include "licenses.h"
QString License::license() {
return QString::fromUtf8(licenseMumble);
}
QString License::authors() {
return QString::fromUtf8(authorsMumble);
}
QList< LicenseInfo > License::thirdPartyLicenses() {
QList< LicenseInfo > licenses;
for (int i = 0; !licenses3rdParties[i].isEmpty(); i++) {
const ThirdPartyLicense *tpl = &licenses3rdParties[i];
LicenseInfo li;
li.name = QString::fromUtf8(tpl->name);
li.url = QString::fromUtf8(tpl->url);
li.license = QString::fromUtf8(tpl->license);
licenses << li;
}
return licenses;
}
QString License::printableThirdPartyLicenseInfo() {
QString output;
QList< LicenseInfo > thirdPartyLicenses = License::thirdPartyLicenses();
foreach (LicenseInfo li, thirdPartyLicenses) {
QString header = QString::fromLatin1("%1 (%2)\n").arg(li.name).arg(li.url);
QString headerHorizLine = QString::fromLatin1("-").repeated(header.size()) + QLatin1String("\n");
output.append(headerHorizLine);
output.append(header);
output.append(headerHorizLine);
output.append(QLatin1String("\n"));
output.append(li.license);
output.append(QLatin1String("\n\n"));
}
return output;
}
|