From df50b6abc3fe03075d28f54c792313654c8278c3 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Sun, 26 Nov 2023 14:56:44 -0500 Subject: [PATCH] models: update for AppStream 1.0 AppStream 1.0.0 includes several API breaks compared to the previous 0.16 (and earlier) versions, but unfortunately both versions used the same 1.0 GI version, so there is no way to differentiate at import time. Therefore, enforce the requirement during the build to make this clear. --- src/meson.build | 1 + src/models/applications.js | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/meson.build b/src/meson.build index f6f901e9..184ec037 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,6 +1,7 @@ pkgdatadir = join_paths(get_option('datadir'), meson.project_name()) gnome = import('gnome') +dependency('appstream', version : '>= 1.0') dependency('libadwaita-1', version : '>= 1.4') dependency('webkitgtk-6.0', version : '>= 2.40') diff --git a/src/models/applications.js b/src/models/applications.js index 1207266a..1c30257a 100644 --- a/src/models/applications.js +++ b/src/models/applications.js @@ -319,14 +319,18 @@ var FlatpakApplicationsModel = GObject.registerClass({ if (component.get_name()) appdata.name = component.get_name(); - if (component.get_developer_name()) - appdata.author = component.get_developer_name(); + const developer = component.get_developer(); + if (developer && developer.get_name()) + appdata.author = developer.get_name(); const launchable = component.get_launchable(AppStream.LaunchableKind.DESKTOP_ID); if (launchable && launchable.get_entries()) [appdata.launchable] = launchable.get_entries(); - const [release] = component.get_releases(); + const releaselist = component.get_releases_plain(); + if (!releaselist) + return appdata; + const [release] = releaselist.get_entries(); if (!release) return appdata;