Summary: | Flatpak runtime version numbers are nonsensical on update page | ||
---|---|---|---|
Product: | [Applications] Discover | Reporter: | Nate Graham <nate> |
Component: | Flatpak Backend | Assignee: | Dan Leinir Turthra Jensen <leinir> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | aleixpol, dschridde+kde, jgrulich, putr4.s, waitman |
Priority: | NOR | ||
Version: | master | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
See Also: | https://bugs.kde.org/show_bug.cgi?id=447033 | ||
Latest Commit: | Version Fixed In: | ||
Attachments: | Nonsense update numbers |
Description
Nate Graham
2022-01-04 15:18:17 UTC
*** Bug 447361 has been marked as a duplicate of this bug. *** Seems like this commit should fix it: https://invent.kde.org/plasma/discover/-/commit/c2f751eb8bf5edbf5b1adea81e6403d94d838401 I ended up writing a patch for myself that does basically the same thing for 5.24.4 (copied below for reference), which fixed the issue for me, as in Discover now says "Update to version ..." for all cases where the version number doesn't change instead of " (...) -> ...", didn't occur to me to check master before going to the trouble lol. The issue was that if the flatpak has no version field and only a branch name (which is the case for the GNOME and KDE runtimes, but not the Freedesktop runtime, this can be seen via the output of `flatpak info`) the old version string ends up looking like " (branch)" while the new version string is just "branch", hence Discover thinks there is a version change and attempts to show that. diff --color --unified --recursive --text discover-5.24.4/libdiscover/backends/FlatpakBackend/FlatpakResource.cpp discover-5.24.4.new/libdiscover/backends/FlatpakBackend/FlatpakResource.cpp --- discover-5.24.4/libdiscover/backends/FlatpakBackend/FlatpakResource.cpp 2022-03-29 22:14:29.000000000 +1100 +++ discover-5.24.4.new/libdiscover/backends/FlatpakBackend/FlatpakResource.cpp 2022-04-03 21:59:03.213976326 +1000 @@ -231,7 +231,10 @@ } if (auto ref = qobject_cast<FlatpakBackend *>(backend())->getInstalledRefForApp(this)) { - return i18nc("version (branch)", "%1 (%2)", flatpak_installed_ref_get_appdata_version(ref), version); + QString appdataVersion = flatpak_installed_ref_get_appdata_version(ref); + if (!appdataVersion.isEmpty()) { + return i18nc("version (branch)", "%1 (%2)", appdataVersion, version); + } } return version; } Please feel free to submit a merge request with that patch targeted at the Plasma/5.24 branch! 5.24 is an LTS release so it would be a good thing to have fixed there too. I cherrypicked the commit from master into this MR for the Plasma/5.24 branch: https://invent.kde.org/plasma/discover/-/merge_requests/287 The MR for the Plasma/5.24 branch has been merged, so I guess it'll be in 5.24.5 whenever that comes out. |