Commit 8d097168 authored by Nate Graham's avatar Nate Graham
Browse files

Fwupd: don't show version number in description for only one update

If a fwupd update includes multiple releases because it's been a while
since you updated, then it makes sense to show the version number of
each invidividual one above that release's description.

But when there is only one release, it's redundant since the same
version number is already shown on the page's metadata bar on the
Application page, and the subtitle on the Updates page. So in this case
let's not show it.
parent ea11c5ac
Pipeline #222748 passed with stage
in 1 minute and 58 seconds
......@@ -119,8 +119,13 @@ void FwupdBackend::addUpdates()
FwupdRelease *release = (FwupdRelease *)g_ptr_array_index(rels, j);
if (!fwupd_release_get_description(release))
continue;
longdescription += QStringLiteral("Version %1\n").arg(QString::fromUtf8(fwupd_release_get_version(release)));
longdescription += QString::fromUtf8(fwupd_release_get_description(release)) + QLatin1Char('\n');
if (rels->len > 1) {
longdescription += QStringLiteral("Version %1\n").arg(QString::fromUtf8(fwupd_release_get_version(release)));
}
longdescription += QString::fromUtf8(fwupd_release_get_description(release));
if (rels->len > 1) {
longdescription += QLatin1Char('\n');
}
}
res->setDescription(longdescription);
addResource(res);
......
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