diff --git a/README.md b/README.md index 29192d2c..acbefe97 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ GitHub Issue Reporter ## Building, Testing, and Installation You'll need the following dependencies: -* libappstream-dev (>=0.12.10) +* libappstream-dev (>=1.0.0) * libgranite-7-dev (>=7.0.0) * libgtk-4-dev (>=4.10) * libadwaita-1-dev (>=1.0.0) diff --git a/meson.build b/meson.build index 02a61e6c..2eb44966 100644 --- a/meson.build +++ b/meson.build @@ -8,14 +8,7 @@ project( gnome = import('gnome') i18n = import('i18n') -appstream_dep = dependency ('appstream', version: '>=0.12.10') - -if appstream_dep.version().version_compare('>=0.15') - add_project_arguments('--define=HAS_APPSTREAM_0_15', language:'vala') -endif -if appstream_dep.version().version_compare('>=1.0') - add_project_arguments('--define=HAS_APPSTREAM_1_0', language:'vala') -endif +appstream_dep = dependency ('appstream', version: '>=1.0') add_project_arguments('-DGETTEXT_PACKAGE="@0@"'.format (meson.project_name()), language:'c') diff --git a/src/MainWindow.vala b/src/MainWindow.vala index 2bc33645..88a6efdf 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -118,21 +118,12 @@ public class Feedback.MainWindow : Gtk.ApplicationWindow { listbox.set_placeholder (placeholder_stack); var appstream_pool = new AppStream.Pool (); -#if HAS_APPSTREAM_0_15 appstream_pool.reset_extra_data_locations (); appstream_pool.set_flags ( appstream_pool.get_flags () | AppStream.PoolFlags.LOAD_FLATPAK | AppStream.PoolFlags.RESOLVE_ADDONS ); -#else - appstream_pool.clear_metadata_locations (); - // flatpak's appstream files exists only inside they sandbox - unowned var appdata_dir = "/var/lib/flatpak/app/%s/current/active/files/share/appdata"; - foreach (var app in app_entries) { - appstream_pool.add_metadata_location (appdata_dir.printf (app)); - } -#endif appstream_pool.load_async.begin (null, (obj, res) => { try { @@ -141,11 +132,7 @@ public class Feedback.MainWindow : Gtk.ApplicationWindow { foreach (var app in app_entries) { var component_table = new HashTable (str_hash, str_equal); -#if HAS_APPSTREAM_1_0 appstream_pool.get_components_by_id (app).as_array ().foreach ((component) => { -#else - appstream_pool.get_components_by_id (app).foreach ((component) => { -#endif if (component_table[component.id] == null) { component_table[component.id] = component; @@ -180,11 +167,7 @@ public class Feedback.MainWindow : Gtk.ApplicationWindow { placeholder_stack.visible_child = placeholder; }); -#if HAS_APPSTREAM_1_0 appstream_pool.get_components_by_id ("io.elementary.settings").as_array ().foreach ((component) => { -#else - appstream_pool.get_components_by_id ("io.elementary.settings").foreach ((component) => { -#endif component.get_addons ().foreach ((addon) => { var repo_row = new RepoRow ( addon.name, @@ -197,11 +180,7 @@ public class Feedback.MainWindow : Gtk.ApplicationWindow { }); }); -#if HAS_APPSTREAM_1_0 appstream_pool.get_components_by_id ("io.elementary.wingpanel").as_array ().foreach ((component) => { -#else - appstream_pool.get_components_by_id ("io.elementary.wingpanel").foreach ((component) => { -#endif component.get_addons ().foreach ((addon) => { var repo_row = new RepoRow ( addon.name, @@ -373,11 +352,7 @@ public class Feedback.MainWindow : Gtk.ApplicationWindow { var components = new GenericArray (); new Thread ("get_compulsory_for_desktop", () => { -#if HAS_APPSTREAM_1_0 appstream_pool.get_components ().as_array ().foreach ((component) => { -#else - appstream_pool.get_components ().foreach ((component) => { -#endif component.get_compulsory_for_desktops ().foreach ((desktop) => { if (desktop == Environment.get_variable ("XDG_CURRENT_DESKTOP")) { components.add (component);