Welcome to mirror list, hosted at ThFree Co, Russian Federation.

License.cpp « src - github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 39f32b69f69c247cdc172226d1b6953e0c9c58f4 (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
// Copyright 2016-2022 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);
}

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;
}