diff options
author | Kalev Lember <klember@redhat.com> | 2018-04-17 13:14:19 +0200 |
---|---|---|
committer | Kalev Lember <klember@redhat.com> | 2018-04-17 13:14:19 +0200 |
commit | 95dd5f7bcbca007145f4c625f6c14c94c40cb481 (patch) | |
tree | 019206123b76df39d3e305457753fdcae34c13b5 | |
parent | 9609d91fb1d5e2be57f17247e1bda2942071161f (diff) | |
download | appstream-glib-95dd5f7bcbca007145f4c625f6c14c94c40cb481.tar.gz |
Veto apps that have empty OnlyShowIn=wip/kalev/veto-empty-onlyshowin
Apps that have OnlyShowIn= are equivalent to NoDisplay=True. Veto such
apps to avoid them inadvertently showing up.
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.c | 5 |
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 */ |