diff options
author | Richard Hughes <richard@hughsie.com> | 2015-06-16 15:53:55 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2015-06-16 15:53:55 +0100 |
commit | 6538d331a842da7132c327e2dd9143012cff05c6 (patch) | |
tree | be9954848227edf3e82718c1f5aca623f1684405 /libappstream-builder | |
parent | 7887549cc09fd886210fa0fcdefc12cfd22b4736 (diff) | |
download | appstream-glib-6538d331a842da7132c327e2dd9143012cff05c6.tar.gz |
Add a flag to relax the AppData Category=Settings requirement
Diffstat (limited to 'libappstream-builder')
-rw-r--r-- | libappstream-builder/asb-context.h | 2 | ||||
-rw-r--r-- | libappstream-builder/plugins/asb-plugin-desktop.c | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/libappstream-builder/asb-context.h b/libappstream-builder/asb-context.h index 4a5f52c..29a75e1 100644 --- a/libappstream-builder/asb-context.h +++ b/libappstream-builder/asb-context.h @@ -72,6 +72,7 @@ struct _AsbContextClass * @ASB_CONTEXT_FLAG_IGNORE_DEAD_UPSTREAM: Include apps that are dead upstream * @ASB_CONTEXT_FLAG_IGNORE_OBSOLETE_DEPS: Include apps that use obsolete toolkits * @ASB_CONTEXT_FLAG_IGNORE_LEGACY_ICONS: Include apps that use legacy icon formats + * @ASB_CONTEXT_FLAG_IGNORE_SETTINGS: Include apps that are marked as settings * * The flags to use when processing the context. **/ @@ -88,6 +89,7 @@ typedef enum { ASB_CONTEXT_FLAG_IGNORE_DEAD_UPSTREAM = 1 << 7, /* Since: 0.4.1 */ ASB_CONTEXT_FLAG_IGNORE_OBSOLETE_DEPS = 1 << 8, /* Since: 0.4.1 */ ASB_CONTEXT_FLAG_IGNORE_LEGACY_ICONS = 1 << 9, /* Since: 0.4.1 */ + ASB_CONTEXT_FLAG_IGNORE_SETTINGS = 1 << 10, /* Since: 0.4.1 */ /*< private >*/ ASB_CONTEXT_FLAG_LAST, } AsbContextFlags; diff --git a/libappstream-builder/plugins/asb-plugin-desktop.c b/libappstream-builder/plugins/asb-plugin-desktop.c index df5d5eb..22ecd42 100644 --- a/libappstream-builder/plugins/asb-plugin-desktop.c +++ b/libappstream-builder/plugins/asb-plugin-desktop.c @@ -335,10 +335,12 @@ asb_plugin_process_filename (AsbPlugin *plugin, asb_app_add_requires_appdata (app, "NoDisplay=true"); /* Settings or DesktopSettings requires AppData */ - if (as_app_has_category (AS_APP (app), "Settings")) - asb_app_add_requires_appdata (app, "Category=Settings"); - if (as_app_has_category (AS_APP (app), "DesktopSettings")) - asb_app_add_requires_appdata (app, "Category=DesktopSettings"); + if (!asb_context_get_flag (plugin->ctx, ASB_CONTEXT_FLAG_IGNORE_SETTINGS)) { + if (as_app_has_category (AS_APP (app), "Settings")) + asb_app_add_requires_appdata (app, "Category=Settings"); + if (as_app_has_category (AS_APP (app), "DesktopSettings")) + asb_app_add_requires_appdata (app, "Category=DesktopSettings"); + } /* is the icon a stock-icon-name? */ icon = as_app_get_icon_default (AS_APP (app)); |