Commit ea11c5ac authored by Nate Graham's avatar Nate Graham
Browse files

Flatpak: Never show both version number and branch name in one UI string

It can be terribly confusing since many apps and runtimes use branch
names that are in the form of a number. So to the user, it looks like
the app has two version numbers which doesn't make sense.

Instead, always show the version number if it's available. If not, only
show the branch name and hopfully it's in the form of a version number
so it looks like a version number to the user.

BUG: 458273
FIXED-IN: 5.26
parent 63658149
Pipeline #222617 passed with stage
in 2 minutes
......@@ -105,16 +105,11 @@ QList<PackageState> FlatpakResource::addonsInformation()
QString FlatpakResource::availableVersion() const
{
QString theBranch = branch();
if (theBranch.isEmpty()) {
theBranch = i18n("Unknown");
}
if (!m_availableVersion.isEmpty()) {
return i18nc("version (branch)", "%1 (%2)", m_availableVersion, theBranch);
return m_availableVersion;
}
return theBranch;
return branch();
}
QString FlatpakResource::appstreamId() const
......@@ -235,19 +230,15 @@ QVariant FlatpakResource::icon() const
QString FlatpakResource::installedVersion() const
{
QString version = branch();
if (version.isEmpty()) {
version = i18n("Unknown");
}
g_autoptr(FlatpakInstalledRef) ref = qobject_cast<FlatpakBackend *>(backend())->getInstalledRefForApp(this);
if (ref) {
const char *appdataVersion = flatpak_installed_ref_get_appdata_version(ref);
if (appdataVersion) {
return i18nc("version (branch)", "%1 (%2)", appdataVersion, version);
return appdataVersion;
}
}
return version;
return branch();
}
quint64 FlatpakResource::installedSize() const
......
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