Commit 1acbdbf4 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧 Committed by Aleix Pol Gonzalez
Browse files

appstream: Do not treat spdx operators as licenses

parent 8e1a6e74
Pipeline #209057 passed with stage
in 1 minute and 14 seconds
......@@ -63,9 +63,13 @@ QPair<QList<QUrl>, QList<QUrl>> AppStreamUtils::fetchScreenshots(const AppStream
QJsonArray AppStreamUtils::licenses(const AppStream::Component &appdata)
{
static const QSet<QChar> tokens = {'&', '+', '|', '^', '(', ')'};
QJsonArray ret;
const auto licenses = AppStream::SPDX::tokenizeLicense(appdata.projectLicense());
for (const auto &token : licenses) {
if (token.size() == 1 && tokens.contains(token.at(0)))
continue;
ret += license(token.mid(1)); // tokenize prefixes with an @ for some reason
}
return ret;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment