Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 1 addition & 8 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down
25 changes: 0 additions & 25 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -141,11 +132,7 @@ public class Feedback.MainWindow : Gtk.ApplicationWindow {
foreach (var app in app_entries) {
var component_table = new HashTable<string, AppStream.Component> (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;

Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -373,11 +352,7 @@ public class Feedback.MainWindow : Gtk.ApplicationWindow {

var components = new GenericArray<AppStream.Component> ();
new Thread<void> ("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);
Expand Down