diff options
author | Richard Hughes <richard@hughsie.com> | 2014-03-26 15:47:47 +0000 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2014-03-26 15:47:47 +0000 |
commit | 721128cbb2c7c5f361cc71b551890e104b670e5a (patch) | |
tree | 2f19b5bc5ae82a8d6ad55db0a3a47f25b8a0d143 /libappstream-glib/as-app.c | |
parent | b956410830176c43212ed974ba5ae94a0ad985b7 (diff) | |
download | appstream-glib-721128cbb2c7c5f361cc71b551890e104b670e5a.tar.gz |
Ignore settings panels when parsing desktop files
We never want to represent a settings panel with an AsApp.
Diffstat (limited to 'libappstream-glib/as-app.c')
-rw-r--r-- | libappstream-glib/as-app.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libappstream-glib/as-app.c b/libappstream-glib/as-app.c index c53fc92..de08503 100644 --- a/libappstream-glib/as-app.c +++ b/libappstream-glib/as-app.c @@ -34,6 +34,8 @@ #include "config.h" +#include <fnmatch.h> + #include "as-app-private.h" #include "as-enums.h" #include "as-node-private.h" @@ -1883,6 +1885,21 @@ as_app_parse_file_key (AsApp *app, key, NULL, NULL); for (i = 0; list[i] != NULL; i++) { + + /* check categories that if present would blacklist + * the application */ + if (fnmatch ("X-*-Settings-Panel", list[i], 0) == 0 || + fnmatch ("X-*-SettingsDialog", list[i], 0) == 0) { + ret = FALSE; + g_set_error (error, + AS_APP_ERROR, + AS_APP_ERROR_INVALID_TYPE, + "category %s is blacklisted", + list[i]); + goto out; + } + + /* ignore some useless keys */ if (g_strcmp0 (list[i], "GTK") == 0) continue; if (g_strcmp0 (list[i], "Qt") == 0) |