From 5a7d76de734b049192b5b992a1e54117b98de733 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Tue, 17 Apr 2018 13:14:19 +0200 Subject: 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 --- libappstream-glib/as-app-desktop.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 */ -- cgit v1.2.1