Commit aa9192f8 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


(cherry picked from commit 1acbdbf4)
parent 678c0f65
Pipeline #209062 passed with stage
in 1 minute and 9 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