Skip to content

Commit

Permalink
models: Update to AppStream 1.0
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
yselkowitz authored and tchx84 committed Sep 18, 2024
1 parent 6274b11 commit fad2b0e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/meson.build
Original file line number Diff line number Diff line change
@@ -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.5')
dependency('webkitgtk-6.0', version : '>= 2.40')

Expand Down
10 changes: 7 additions & 3 deletions src/models/applications.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,14 +326,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;

Expand Down

0 comments on commit fad2b0e

Please sign in to comment.