summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKalev Lember <klember@redhat.com>2018-04-17 13:14:19 +0200
committerRichard Hughes <richard@hughsie.com>2018-04-17 16:14:55 +0100
commit5a7d76de734b049192b5b992a1e54117b98de733 (patch)
tree019206123b76df39d3e305457753fdcae34c13b5
parent9609d91fb1d5e2be57f17247e1bda2942071161f (diff)
downloadappstream-glib-5a7d76de734b049192b5b992a1e54117b98de733.tar.gz
Veto apps that have empty OnlyShowIn=
Apps that have OnlyShowIn= are equivalent to NoDisplay=True (gnome-shell doesn't show them). Veto such apps to avoid them inadvertently showing up in gnome-software and to match gnome-shell behaviour. https://bugzilla.redhat.com/show_bug.cgi?id=1567689 https://gitlab.gnome.org/GNOME/gnome-software/issues/367
-rw-r--r--libappstream-glib/as-app-desktop.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libappstream-glib/as-app-desktop.c b/libappstream-glib/as-app-desktop.c
index fadf4ab..ee5742d 100644
--- a/libappstream-glib/as-app-desktop.c
+++ b/libappstream-glib/as-app-desktop.c
@@ -324,7 +324,10 @@ as_app_parse_file_key (AsApp *app,
G_KEY_FILE_DESKTOP_GROUP,
key,
NULL, NULL);
- if (g_strv_length (list) == 1)
+ /* "OnlyShowIn=" is the same as "NoDisplay=True" */
+ if (g_strv_length (list) == 0)
+ as_app_add_veto (app, "Empty OnlyShowIn");
+ else if (g_strv_length (list) == 1)
as_app_set_project_group (app, list[0]);
/* Name */