Skip to content

Commit

Permalink
Veto apps that have empty OnlyShowIn=
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kalev committed Apr 17, 2018
1 parent 9609d91 commit 95dd5f7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libappstream-glib/as-app-desktop.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 95dd5f7

Please sign in to comment.