[gnome-software: 2/6] gs-appstream: Fix getting apps for categories if first group is empty
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software: 2/6] gs-appstream: Fix getting apps for categories if first group is empty
- Date: Wed, 25 May 2022 13:28:45 +0000 (UTC)
commit e6b16b61b690bdbeb2b7642b29879370d079491e
Author: Philip Withnall <pwithnall endlessos org>
Date: Wed May 25 12:04:23 2022 +0100
gs-appstream: Fix getting apps for categories if first group is empty
Categories in gnome-software each comprise one or more XDG standardised
desktop groups, and are the union of all the apps in those groups.
Previously, the code in `gs_appstream_add_category_apps()` would
incorrectly return if any of the queries for apps in a particular
desktop group returned no results. This meant the remaining groups in
the category would not be checked.
Fix that by continuing on to the next group if a query returns no
results.
Spotted by code inspection.
Signed-off-by: Philip Withnall <pwithnall endlessos org>
lib/gs-appstream.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/lib/gs-appstream.c b/lib/gs-appstream.c
index e2dba583e..e9329feeb 100644
--- a/lib/gs-appstream.c
+++ b/lib/gs-appstream.c
@@ -1495,7 +1495,6 @@ gs_appstream_add_category_apps (GsPlugin *plugin,
GError **error)
{
GPtrArray *desktop_groups;
- g_autoptr(GError) error_local = NULL;
desktop_groups = gs_category_get_desktop_groups (category);
if (desktop_groups->len == 0) {
@@ -1507,6 +1506,7 @@ gs_appstream_add_category_apps (GsPlugin *plugin,
g_autofree gchar *xpath = NULL;
g_auto(GStrv) split = g_strsplit (desktop_group, "::", -1);
g_autoptr(GPtrArray) components = NULL;
+ g_autoptr(GError) error_local = NULL;
/* generate query */
if (g_strv_length (split) == 1) {
@@ -1522,7 +1522,7 @@ gs_appstream_add_category_apps (GsPlugin *plugin,
components = xb_silo_query (silo, xpath, 0, &error_local);
if (components == NULL) {
if (g_error_matches (error_local, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
- return TRUE;
+ continue;
g_propagate_error (error, g_steal_pointer (&error_local));
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]