55static void generate(QTextStream &out,
const Package &package,
const QDir &baseDir)
58 for (
const QString &part : package.qtParts) {
59 out <<
"\\ingroup attributions-" << package.qdocModule <<
"-" << part <<
"\n";
60 out <<
"\\ingroup attributions-" << part <<
"\n";
63 if (package.qtParts.contains(
"libs"_L1)) {
65 out <<
"\\ingroup attributions-" << package.qdocModule <<
"\n";
67 out <<
"\\page " << package.qdocModule <<
"-attribution-" << package.id
69 out <<
"\\attribution\n";
71 out <<
"\\page " << package.qdocModule <<
"-attribution-" << package.id
75 out <<
"\\target " << package.id <<
"\n\n";
76 out <<
"\\title " << package.name;
77 if (!package.version.isEmpty())
78 out <<
", version " << package.version;
79 out <<
"\n\n\\brief " << package.license <<
"\n\n";
81 if (!package.description.isEmpty())
82 out << package.description <<
"\n\n";
84 if (!package.qtUsage.isEmpty())
85 out << package.qtUsage <<
"\n\n";
88 QStringList sourcePaths;
89 if (package.files.isEmpty()) {
90 sourcePaths << baseDir.relativeFilePath(package.path);
92 const QDir packageDir(package.path);
93 for (
const QString &filePath : package.files) {
94 const QString absolutePath = packageDir.absoluteFilePath(filePath);
95 sourcePaths << baseDir.relativeFilePath(absolutePath);
99 out <<
"The sources can be found in " << languageJoin(sourcePaths) <<
".\n\n";
102 const bool hasPackageVersion = !package.version.isEmpty();
103 const bool hasPackageDownloadLocation = !package.downloadLocation.isEmpty();
104 if (!package.homepage.isEmpty()) {
105 out <<
"\\l{" << package.homepage <<
"}{Project Homepage}";
106 if (hasPackageVersion)
109 if (hasPackageVersion) {
110 out <<
"upstream version: ";
111 if (hasPackageDownloadLocation)
112 out <<
"\\l{" << package.downloadLocation <<
"}{";
113 out << package.version;
114 if (hasPackageDownloadLocation)
121 if (!package.copyright.isEmpty())
122 copyright = package.copyright;
123 else if (!package.copyrightFileContents.isEmpty())
124 copyright = package.copyrightFileContents;
126 if (!copyright.isEmpty()) {
128 sourceCode(out, copyright);
131 if (isSpdxLicenseId(package.licenseId) && !package.licenseId.startsWith(
"LicenseRef-"_L1)
132 && package.licenseId !=
"NONE"_L1) {
133 out <<
"\\l{https://spdx.org/licenses/" << package.licenseId <<
".html}"
134 <<
"{" << package.license <<
"}.\n\n";
136 out << package.license <<
".\n\n";
139 for (
const QString &license : package.licenseFilesContents)
140 sourceCode(out, license);