Commit 84624c86 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧 Committed by Aleix Pol Gonzalez
Browse files

flatpak: Get the version from the appstream file we are fed

flatpak_installed_ref_get_appdata_version will give us the installed
version.

BUG: 448521
parent f48d1dca
Pipeline #222454 passed with stage
in 3 minutes and 4 seconds
......@@ -24,6 +24,7 @@
#include <AppStreamQt/icon.h>
#include <AppStreamQt/metadata.h>
#include <AppStreamQt/pool.h>
#include <AppStreamQt/release.h>
#include <KAboutData>
#include <KConfigGroup>
......@@ -1392,9 +1393,7 @@ ResultsStream *FlatpakBackend::search(const AbstractResourcesBackend::Filters &f
for (auto ref : qAsConst(it.value())) {
bool fresh;
auto resource = getAppForInstalledRef(it.key(), ref, &fresh);
#if FLATPAK_CHECK_VERSION(1, 1, 2)
resource->setAvailableVersion(QString::fromUtf8(flatpak_installed_ref_get_appdata_version(ref)));
#endif
resource->setAvailableVersion(resource->appdata().releases().constFirst().version());
g_object_unref(ref);
resource->setState(AbstractResource::Upgradeable, !fresh);
updateAppSize(resource);
......
......@@ -194,6 +194,11 @@ public:
Q_INVOKABLE void clearUserData();
Q_INVOKABLE bool isOlderThan(FlatpakResource *resource) const;
const AppStream::Component appdata() const
{
return m_appdata;
}
Q_SIGNALS:
void hasDataButUninstalledChanged();
void propertyStateChanged(FlatpakResource::PropertyKind kind, FlatpakResource::PropertyState state);
......
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